[R] Two Factors and a Numeric Variable in a Plot

2011-02-09 Thread Rodrigo Aluizio
Hi list.

I'm trying to plot a graph by factors. Exactly, the x axis are my depths
(as.factor), my left y axis are my transects (also as.factor) and I want to
plot the mean and standard deviation (three samples per factor combination)
of my SW (numeric) variable. The second y axis (at the right) will,
probably, need to be displayed several times (for both left y axis values
- A and B).

Below is a part of what I'm trying to plot. The problem is that this time I
have no idea on how to do so! Nor even how to begin. Any ideas?

 


Samples

SW

Depth

Transect


A01_R1

0.782163

1

A


A01_R2

0.678205

1

A


A01_R3

0.673248

1

A


A02_R1

0.775284

2

A


A02_R2

0.866862

2

A


A02_R3

0.870709

2

A


A03_R1

0.881894

3

A


A03_R2

0.820127

3

A


A03_R3

0.867685

3

A


A04_R1

0.906944

4

A


A04_R2

0.941329

4

A


A04_R3

0.924741

4

A


A05_R1

0.973075

5

A


A05_R2

0.96872

5

A


A05_R3

0.95

5

A


B01_R1

0.912486

1

B


B01_R2

0.931048

1

B


B01_R3

0.921488

1

B


B02_R1

0.94216

2

B


B02_R2

0.905211

2

B


B02_R3

0.950491

2

B


B03_R1

0.951062

3

B


B03_R2

0.945663

3

B


B03_R3

0.956717

3

B


B04_R1

0.974706

4

B


B04_R2

0.966461

4

B


B04_R3

0.949697

4

B


B05_R1

0.958339

5

B


B05_R2

0.952168

5

B


B05_R3

0.96301

5

B

 

Thank you very much.

Regards.

 

---

MSc.  mailto:r.alui...@gmail.com Rodrigo Aluizio

Centro de Estudos do Mar/UFPR



 


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Postscript function Bug at R x64 2.12.1?

2011-01-11 Thread Rodrigo Aluizio
Hi list. I was saving my modified pairs graphic using a custom panel from
the R Graphics site, and I got an interesting difference in the final image
when I save it as eps or png.

This custom panel make possible to show at the left side of the pairs plot
the p-value as symbol and the correlation r value with its cex proportional
to the r value itself.

 

Well, when saving as a png file everything is pretty fine. But, if I save it
as an eps, one of the r values (0.0056) gets extremely bigger than it should
, and it's the only one presenting this behavior.

 

P.S.: I use GIMP 2.6.11 (x86) and GhostScript 9.00 (x86) to render the eps
file, I don't know if it could be an issue of one of these other softwares.

 

Below are the script that generates everything, a link to an example matrix
(csv) and a Sys.info result.

 

The link to an example data

 

http://dl.dropbox.com/u/2613625/Groups.csv

 

The script without the part used to import the data

 

# Analysis

cor.prob - function(X, dfr = nrow(X) - 2) {

R - cor(X)

above - row(R)  col(R)

r2 - R[above]^2

Fstat - r2 * dfr / (1 - r2)

R[above] - 1 - pf(Fstat, 1, dfr)

R

}

cor.prob(Grupos[,-7])

 

# Custom upper pairs panel

panel.cor - function(x, y, digits=2, prefix=, cex.cor) 

{

usr - par(usr); on.exit(par(usr)) 

par(usr = c(0, 1, 0, 1)) 

r - abs(cor(x, y)) 

txt - format(c(r, 0.123456789), digits=digits)[1] 

txt - paste(prefix, txt, sep=) 

if(missing(cex.cor)) cex - 0.8/strwidth(txt) 

 

test - cor.test(x,y) 

# borrowed from printCoefmat

Signif - symnum(test$p.value, corr = FALSE, na = FALSE, 

  cutpoints = c(0, 0.001, 0.01, 0.05, 0.1, 1),

  symbols = c(***, **, *, .,  )) 

 

text(0.5, 0.5, txt, cex = cex * r) 

text(.8, .8, Signif, cex=cex, col=2) 

}

 

# Saving the Graphics

postscript('CorMatrix.eps',paper='special',onefile=F,horizontal=F,bg='white'
,width=7,height=7,pointsize=9) # Here the issue pops up

par(pty='m')

pairs(Grupos[,-7],lower.panel=panel.smooth,upper.panel=panel.cor)

dev.off()

 

png('CorMatrix.png',bg='white',width=2800,height=2800,res=300) # Here
everything goes fine

par(pty='m')

pairs(Grupos[,-7],lower.panel=panel.smooth,upper.panel=panel.cor)

dev.off()

 

# System Information

Sys.info()

 sysname  release  version nodename  machine
login 

   Windows  7 x64 build 7600 RODRIGO-PC x86-64
Rodrigo 

user 

   Rodrigo

 

Hope you can help me find out what is going on!

Regards

---

MSc.  mailto:r.alui...@gmail.com Rodrigo Aluizio


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Postscript function Bug at R x64 2.12.1?

2011-01-11 Thread Rodrigo Aluizio
Hi, a correction in the previous script. Anyone who tries to use it must
ignore (remove) the [,-7] after the Grupos object.

 

Sorry.

 

De: Rodrigo Aluizio [mailto:r.alui...@gmail.com] 
Enviada em: terça-feira, 11 de janeiro de 2011 11:01
Para: R Help
Assunto: Postscript function Bug at R x64 2.12.1?

 

Hi list. I was saving my modified pairs graphic using a custom panel from
the R Graphics site, and I got an interesting difference in the final image
when I save it as eps or png.

This custom panel make possible to show at the left side of the pairs plot
the p-value as symbol and the correlation r value with its cex proportional
to the r value itself.

 

Well, when saving as a png file everything is pretty fine. But, if I save it
as an eps, one of the r values (0.0056) gets extremely bigger than it should
, and it’s the only one presenting this behavior.

 

P.S.: I use GIMP 2.6.11 (x86) and GhostScript 9.00 (x86) to render the eps
file, I don’t know if it could be an issue of one of these other softwares.

 

Below are the script that generates everything, a link to an example matrix
(csv) and a Sys.info result.

 

The link to an example data

 

http://dl.dropbox.com/u/2613625/Groups.csv

 

The script without the part used to import the data

 

# Analysis

cor.prob - function(X, dfr = nrow(X) - 2) {

R - cor(X)

above - row(R)  col(R)

r2 - R[above]^2

Fstat - r2 * dfr / (1 - r2)

R[above] - 1 - pf(Fstat, 1, dfr)

R

}

cor.prob(Grupos[,-7])

 

# Custom upper pairs panel

panel.cor - function(x, y, digits=2, prefix=, cex.cor) 

{

usr - par(usr); on.exit(par(usr)) 

par(usr = c(0, 1, 0, 1)) 

r - abs(cor(x, y)) 

txt - format(c(r, 0.123456789), digits=digits)[1] 

txt - paste(prefix, txt, sep=) 

if(missing(cex.cor)) cex - 0.8/strwidth(txt) 

 

test - cor.test(x,y) 

# borrowed from printCoefmat

Signif - symnum(test$p.value, corr = FALSE, na = FALSE, 

  cutpoints = c(0, 0.001, 0.01, 0.05, 0.1, 1),

  symbols = c(***, **, *, .,  )) 

 

text(0.5, 0.5, txt, cex = cex * r) 

text(.8, .8, Signif, cex=cex, col=2) 

}

 

# Saving the Graphics

postscript('CorMatrix.eps',paper='special',onefile=F,horizontal=F,bg='white'
,width=7,height=7,pointsize=9) # Here the issue pops up

par(pty='m')

pairs(Grupos[,-7],lower.panel=panel.smooth,upper.panel=panel.cor)

dev.off()

 

png('CorMatrix.png',bg='white',width=2800,height=2800,res=300) # Here
everything goes fine

par(pty='m')

pairs(Grupos[,-7],lower.panel=panel.smooth,upper.panel=panel.cor)

dev.off()

 

# System Information

Sys.info()

 sysname  release  version nodename  machine
login 

   Windows  7 x64 build 7600 RODRIGO-PC x86-64
Rodrigo 

user 

   Rodrigo

 

Hope you can help me find out what is going on!

Regards

---

MSc. Rodrigo Aluizio mailto:r.alui...@gmail.com 


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] RES: Barplot with Independent Lines Y axis

2010-12-11 Thread Rodrigo Aluizio
Well, at least I could help (even if unintentionally), as a
compensation for all the help I got from the list.

Cheers.

Em sexta-feira, 10 de dezembro de 2010, Jim Lemonj...@bitwrit.com.au escreveu:
 On 12/10/2010 08:48 PM, Rodrigo Aluizio wrote:

 OK that's it. Working nicely. I sent the final graph with the note of the
 twoord.plot help attached to it. And some personal comments


 Hi Rodrigo,
 Although I came rather late to this, I might as well show how I did it:

 # first I corrected the commas as Peter pointed out
 library(plotrix)
 par(las=3)
 twoord.plot(ly=pluv_sal$Rain,lx=pluv_sal$Salt,mar=c(6,4,4,2),
  xlab=,ylab=Rainfall (mm),rylab=Salinity,type=c(bar,b),
  main=Rainfall and salinity,lcol=NA,rcol=2,
  xticklab=pluv_sal$Point,xaxt=n)
 par(las=0)
 mtext(Month,side=1,at=7,line=3)

 You did find a bug in the twoord.plot function, and the next version of 
 plotrix will contain one more bug fix, with thanks to you.

 Jim



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] RES: Barplot with Independent Lines Y axis

2010-12-10 Thread Rodrigo Aluizio
OK that's it. Working nicely. I sent the final graph with the note of the
twoord.plot help attached to it. And some personal comments
Thank you very much for all the help and remarks.

Rodrigo.

2010/12/10 Dennis Murphy djmu...@gmail.com

 Hi:

 Like Peter Ehlers, I'm not a big fan of multiple response variables on a
 page with different y-axis scaling, but if you have to do it, try not to let
 one graphical metaphor interfere with/obscure/dominate the other (e.g., bars
 and lines). This is my attempt, both with connecting lines and points, but
 am holding my nose in the process:

 library(plotrix)
 dd - read.table(textConnection(

 Point   RainSalt
 Fev/03  365.6   13
 Mar/03  235 18
 Abr/03  115.1   18
 Mai/03  47.418.75
 Jun/03  112 15
 Jul/03  156.8   17
 Ago/03  66.115
 Set/03  149.8   14
 Out/03  167.1   11.5
 Nov/03  269.3   17.5
 Dez/03  283.7   NA

 Jan/04  415 1.3
 Fev/04  322 8.5
 Mar/04  258.7   10.5), header = TRUE, stringsAsFactors = FALSE)
 closeAllConnections()

 dd$mo - seq(nrow(dd))

 with(dd,
   twoord.plot(lx = mo, ly = Rain, rx = mo, ry = Salt,
   lylim = c(0, 450), rylim = c(0, 20),
   lcol = 'red', rcol = 'blue',
   lpch = 1, rpch = 16, type = c('b', 'b'),
   xtickpos = mo, xticklab = Point)
 )
 legend('bottomleft', leg = c('Rain (left axis)', 'Salt (right axis)'),
  text.col = c('red', 'blue'), col = c('red', 'blue'), lty = c(1, 1)
 )

 I understand why these types of plots exist in general, and I can see why
 you might want to compare two variables that are temporally related but have
 different units of measurement, but by doing so, you are increasing the
 cognitive task of the average viewer. As Greg Snow mentioned, read the
 section of ?twoord,plot headlined 'Note' and observe that this plot has
 crossing profiles (points connected by lines).  And remember that it's your
 responsibility to properly convey the message of the plot to the viewer...

 HTH,
 Dennis

 On Thu, Dec 9, 2010 at 2:22 PM, Rodrigo Aluizio r.alui...@gmail.comwrote:

 Oh sorry. An example say lots more than words. The data below, when
 submitted to twoord.plot return the mentioned error. Rain are bars and
 Salt
 lines, the bars appear and the error occurs with the salt data.

 Point   RainSalt
 Fev/03  365.6   13
 Mar/03  235 18
 Abr/03  115.1   18
 Mai/03  47.418.75
 Jun/03  112 15
 Jul/03  156.8   17
 Ago/03  66.115
 Set/03  149.8   14
 Out/03  167,1   11.5
 Nov/03  269.3   17.5
 Dez/03  283.7
 Jan/04  415 1,3
 Fev/04  322 8,5
 Mar/04  258.7   10.5

 -Mensagem original-
 De: Greg Snow [mailto:greg.s...@imail.org]
 Enviada em: quinta-feira, 9 de dezembro de 2010 17:57
 Para: Rodrigo Aluizio; 'R Help'
 Assunto: RE: [R] Barplot with Independent Lines Y axis

 Without seeing a reproducible example we cannot be sure, but my guess is
 that you are letting twoord.plot set the limits and the function does not
 remove missing values, if you specify rylim and or lylim arguments
 specifically, then it should not run into the problem you are seeing (I
 hope).

 If that does not work, then send a small reproducible example (the dput
 command is great for the data part) which will help us find the problem.

 --
 Gregory (Greg) L. Snow Ph.D.
 Statistical Data Center
 Intermountain Healthcare
 greg.s...@imail.org
 801.408.8111


  -Original Message-
  From: Rodrigo Aluizio [mailto:r.alui...@gmail.com]
  Sent: Thursday, December 09, 2010 12:27 PM
  To: Greg Snow; 'R Help'
  Subject: RES: [R] Barplot with Independent Lines Y axis
 
  Thank you for the function suggestion, works nicely for complete data
  vectors. Just another question. When using the twoord.plot I reached
  another
  issue, it seems that this function can't handle NAs in one of the
  variables
  (the data of one month for another variable is missing). The lines and
  barplot functions just interrupt the plot and continue after the NA but
  twoord.plot gives me an error: Error at plot.window(...) : finite
  values are
  necessary for 'ylim'
 
  Is there a way to work around this error?
 
  P.S.: I'm aware of the problems regarding this type of graph, but this
  time
  it's not a choice of mine (unfortunately). Thank you anyway for the
  highlight, maybe it will help me arguing.
 
  Regards
 
  Rodrigo.
 
  -Mensagem original-
  De: Greg Snow [mailto:greg.s...@imail.org]
  Enviada em: quinta-feira, 9 de dezembro de 2010 15:56
  Para: Rodrigo Aluizio; R Help
  Assunto: RE: [R] Barplot with Independent Lines Y axis
 
  Look at the twoord.plot function in the plotrix package, but be sure to
  read
  the note on the help page, then reread it and take its advice if you
  decide
  to stick with this type of plot.
 
  --
  Gregory (Greg) L. Snow Ph.D.
  Statistical Data Center
  Intermountain Healthcare
  greg.s...@imail.org
  801.408.8111
 
 
   -Original Message-
   From: r-help-boun...@r-project.org [mailto:r-help-boun

[R] Barplot with Independent Lines Y axis

2010-12-09 Thread Rodrigo Aluizio
Hi list. I'm plotting pluviometric (Rain) data as a barplot, and then adding
the salinity variable to this plot as lines. Obviously as these Y scales are
completely different the salinity appears at the lower part of the graph
extremely compacted. I need to plot the line at the exactly same area of the
barplot but with its own Y axis (at the right), so the salinity can use the
plot area freely. I tried the par(new=T), but it only works for high level
plot functions (not for lines or points).

Below are some example data and the code I'm using:

Month   RainSalt
Fev 365.6   13
Mar 235 18
Abr 115.1   18
Mai 47.418.75
Jun 112 15
Jul 156.8   17
Ago 66.115
Set 149.8   14
Out 167.1   11.5
Nov 269.3   17.5

mp-barplot(Dados$Rain,names.arg=rownames(Dados),ylab='Pluviosidade
(mm)',width=0.5,ylim=c(0,370),yaxp=c(0,370,10))
lines(mp,Dados$Salt,type='b',pch=19,lty='dotted')

Any ideas?

Thank you for the attention.

Regards

---
MSc. Rodrigo Aluizio
Centro de Estudos do Mar/UFPR

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RES: Barplot with Independent Lines Y axis

2010-12-09 Thread Rodrigo Aluizio
Thank you for the function suggestion, works nicely for complete data
vectors. Just another question. When using the twoord.plot I reached another
issue, it seems that this function can't handle NAs in one of the variables
(the data of one month for another variable is missing). The lines and
barplot functions just interrupt the plot and continue after the NA but
twoord.plot gives me an error: Error at plot.window(...) : finite values are
necessary for 'ylim' 

Is there a way to work around this error?

P.S.: I'm aware of the problems regarding this type of graph, but this time
it's not a choice of mine (unfortunately). Thank you anyway for the
highlight, maybe it will help me arguing.

Regards

Rodrigo.

-Mensagem original-
De: Greg Snow [mailto:greg.s...@imail.org] 
Enviada em: quinta-feira, 9 de dezembro de 2010 15:56
Para: Rodrigo Aluizio; R Help
Assunto: RE: [R] Barplot with Independent Lines Y axis

Look at the twoord.plot function in the plotrix package, but be sure to read
the note on the help page, then reread it and take its advice if you decide
to stick with this type of plot.

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
 project.org] On Behalf Of Rodrigo Aluizio
 Sent: Thursday, December 09, 2010 9:44 AM
 To: R Help
 Subject: [R] Barplot with Independent Lines Y axis
 
 Hi list. I'm plotting pluviometric (Rain) data as a barplot, and then
 adding
 the salinity variable to this plot as lines. Obviously as these Y
 scales are
 completely different the salinity appears at the lower part of the
 graph
 extremely compacted. I need to plot the line at the exactly same area
 of the
 barplot but with its own Y axis (at the right), so the salinity can use
 the
 plot area freely. I tried the par(new=T), but it only works for high
 level
 plot functions (not for lines or points).
 
 Below are some example data and the code I'm using:
 
 Month RainSalt
 Fev   365.6   13
 Mar   235 18
 Abr   115.1   18
 Mai   47.418.75
 Jun   112 15
 Jul   156.8   17
 Ago   66.115
 Set   149.8   14
 Out   167.1   11.5
 Nov   269.3   17.5
 
 mp-barplot(Dados$Rain,names.arg=rownames(Dados),ylab='Pluviosidade
 (mm)',width=0.5,ylim=c(0,370),yaxp=c(0,370,10))
 lines(mp,Dados$Salt,type='b',pch=19,lty='dotted')
 
 Any ideas?
 
 Thank you for the attention.
 
 Regards
 
 ---
 MSc. Rodrigo Aluizio
 Centro de Estudos do Mar/UFPR
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-
 guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RES: Barplot with Independent Lines Y axis

2010-12-09 Thread Rodrigo Aluizio
Oh sorry. An example say lots more than words. The data below, when
submitted to twoord.plot return the mentioned error. Rain are bars and Salt
lines, the bars appear and the error occurs with the salt data.

Point   RainSalt
Fev/03  365.6   13
Mar/03  235 18
Abr/03  115.1   18
Mai/03  47.418.75
Jun/03  112 15
Jul/03  156.8   17
Ago/03  66.115
Set/03  149.8   14
Out/03  167,1   11.5
Nov/03  269.3   17.5
Dez/03  283.7   
Jan/04  415 1,3
Fev/04  322 8,5
Mar/04  258.7   10.5

-Mensagem original-
De: Greg Snow [mailto:greg.s...@imail.org] 
Enviada em: quinta-feira, 9 de dezembro de 2010 17:57
Para: Rodrigo Aluizio; 'R Help'
Assunto: RE: [R] Barplot with Independent Lines Y axis

Without seeing a reproducible example we cannot be sure, but my guess is
that you are letting twoord.plot set the limits and the function does not
remove missing values, if you specify rylim and or lylim arguments
specifically, then it should not run into the problem you are seeing (I
hope).

If that does not work, then send a small reproducible example (the dput
command is great for the data part) which will help us find the problem.

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111


 -Original Message-
 From: Rodrigo Aluizio [mailto:r.alui...@gmail.com]
 Sent: Thursday, December 09, 2010 12:27 PM
 To: Greg Snow; 'R Help'
 Subject: RES: [R] Barplot with Independent Lines Y axis
 
 Thank you for the function suggestion, works nicely for complete data
 vectors. Just another question. When using the twoord.plot I reached
 another
 issue, it seems that this function can't handle NAs in one of the
 variables
 (the data of one month for another variable is missing). The lines and
 barplot functions just interrupt the plot and continue after the NA but
 twoord.plot gives me an error: Error at plot.window(...) : finite
 values are
 necessary for 'ylim'
 
 Is there a way to work around this error?
 
 P.S.: I'm aware of the problems regarding this type of graph, but this
 time
 it's not a choice of mine (unfortunately). Thank you anyway for the
 highlight, maybe it will help me arguing.
 
 Regards
 
 Rodrigo.
 
 -Mensagem original-
 De: Greg Snow [mailto:greg.s...@imail.org]
 Enviada em: quinta-feira, 9 de dezembro de 2010 15:56
 Para: Rodrigo Aluizio; R Help
 Assunto: RE: [R] Barplot with Independent Lines Y axis
 
 Look at the twoord.plot function in the plotrix package, but be sure to
 read
 the note on the help page, then reread it and take its advice if you
 decide
 to stick with this type of plot.
 
 --
 Gregory (Greg) L. Snow Ph.D.
 Statistical Data Center
 Intermountain Healthcare
 greg.s...@imail.org
 801.408.8111
 
 
  -Original Message-
  From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
  project.org] On Behalf Of Rodrigo Aluizio
  Sent: Thursday, December 09, 2010 9:44 AM
  To: R Help
  Subject: [R] Barplot with Independent Lines Y axis
 
  Hi list. I'm plotting pluviometric (Rain) data as a barplot, and then
  adding
  the salinity variable to this plot as lines. Obviously as these Y
  scales are
  completely different the salinity appears at the lower part of the
  graph
  extremely compacted. I need to plot the line at the exactly same area
  of the
  barplot but with its own Y axis (at the right), so the salinity can
 use
  the
  plot area freely. I tried the par(new=T), but it only works for high
  level
  plot functions (not for lines or points).
 
  Below are some example data and the code I'm using:
 
  Month   RainSalt
  Fev 365.6   13
  Mar 235 18
  Abr 115.1   18
  Mai 47.418.75
  Jun 112 15
  Jul 156.8   17
  Ago 66.115
  Set 149.8   14
  Out 167.1   11.5
  Nov 269.3   17.5
 
  mp-barplot(Dados$Rain,names.arg=rownames(Dados),ylab='Pluviosidade
  (mm)',width=0.5,ylim=c(0,370),yaxp=c(0,370,10))
  lines(mp,Dados$Salt,type='b',pch=19,lty='dotted')
 
  Any ideas?
 
  Thank you for the attention.
 
  Regards
 
  ---
  MSc. Rodrigo Aluizio
  Centro de Estudos do Mar/UFPR
 
  __
  R-help@r-project.org mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide http://www.R-project.org/posting-
  guide.html
  and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Lottery with Data Frame Rows

2010-10-07 Thread Rodrigo Aluizio
Hi List.

I've to perform a sequence of conditional sampling without repetition from a
very simple data frame.

It contains the samples and people names (which picked the sample).
Something like this (but much more longer):

 


Sample

Picker


4ME1B2 B

Ana


4ME1C1 B

Ana


4ME1D2 C

Ana


4ME1E2 C

Ana


4ME1E3 A

Ana


4ME2A1 C

Ana


4ME2D2 B

Ana


4CME3 B

Ingrid


4CME7 C

Ana


4ME1B1 C

Elis


4ME1B2 C

Elis


4ME1C1 C

Elis


4ME1D2 A

Elis


4ME2B2 B

Elis


4ME2B3 A

Ingrid


4ME2B4 A

Elis


4ME2C1 B

Elis


4ME2C4 C

Elis


4ME2D3 C

Ingrid


4ME2C2 C

Ingrid


4ME2D1 B

Ingrid


4ME2D2 C

Ingrid

 

Well then, these samples must be reviewed. To do so I've to create random
sets of samples for each person that not include the person's own samples
and, obviously, can't repeat samples at the next set (of the next person).
Each person will have to review the same number of samples he/she picked.

 

I've tried sample() function, but it doesn't do well with data frames, so
it's getting tricky to work around.

 

Any suggestions or ideas?

 

Thank you for your attention and sorry for the silly question.

 

---

MSc.  mailto:r.alui...@gmail.com Rodrigo Aluizio


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RODBC and Excel 2010 xlsx

2010-07-13 Thread Rodrigo Aluizio
Hi List, just to know if the issue is only a problem of mine or if it is a
general issue due to the new MS Office pack. I'm using R 2.11.1 32 bits in a
Windows 7 x64 with the MS office 2010 x64 installed. I can import .xls files
normally (the same way I did with my Excel 2007 32 bits). But the function
odbcConnectExcel2007 isn't able to import .xlsx files now that I have the
new version of the Office package.

It gives me the following warning message, which make impossible the
importing process through sqlFetch:
Warning messages:
1: In odbcDriverConnect(con, tabQuote = c([, ]), ...) :
  [RODBC] ERROR: state IM002, code 0, message [Microsoft][ODBC Driver
Manager] Nome da fonte de dados não encontrado e nenhum driver padrão
especificado (Source name not found and no default driver specified)
2: In odbcDriverConnect(con, tabQuote = c([, ]), ...) :
  ODBC connection failed

I'm obviously bypassing it converting my .xlsx files to .xls.
Well the question is simple. Is this an expected issue, like the one when
the xlsx format was released and it will be worked out, or I'm having and
specific problem at one of my system components (drivers)?

Thank you very much for the attention.

Rodrigo Aluizio

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] [R-sig-Geo] How to extract coordinates values from a shapefile?

2010-06-09 Thread Rodrigo Aluizio
I'm not sure if this is what you want. But the function coordinates() in sp
package gives you the coordinates of SpatialObjects.

Regards.

Rodrigo.

2010/6/9 Nikhil Kaza nikhil.l...@gmail.com

 You need to execute gpclibPermit()  to enable gpclib.

 library(maptools) should have issued a warning to that effect.


 Nikhil Kaza
 Asst. Professor,
 City and Regional Planning
 University of North Carolina

 nikhil.l...@gmail.com

 On Jun 9, 2010, at 3:34 PM, Thiago Veloso wrote:

Dear Nikhil,
 
Thank you for your input. I tried your suggestion and received the
  following error:
 
   fortify(br)
  Using UF_05 to define regions.
  Error: isTRUE(gpclibPermitStatus()) is not TRUE
  
 
Do you know what else could be done?
 
Best wishes,
 
Thiago.
 
  --- On Wed, 9/6/10, Nikhil Kaza nikhil.l...@gmail.com wrote:
 
  From: Nikhil Kaza nikhil.l...@gmail.com
  Subject: Re: [R-sig-Geo] How to extract coordinates values from a
  shapefile?
  To: Thiago Veloso thi_vel...@yahoo.com.br
  Cc: r-sig-...@stat.math.ethz.ch
  Date: Wednesday, 9 June, 2010, 16:00
 
  Look at this. Not sure if this is indeed what you want or if you
  actually have to unproject them.
 
  http://www.mail-archive.com/r-sig-...@stat.math.ethz.ch/msg04715.html
 
  require(ggplot2)
  fortify(br)
 
 
  Nikhil Kaza
  Asst. Professor,
  City and Regional Planning
  University of North Carolina
 
  nikhil.l...@gmail.com
 
  On Jun 9, 2010, at 2:45 PM, Thiago Veloso wrote:
 
 Dear R colleagues,
 Does anyone know if it's possible to create a vector with
  coordinate values extracted from a shape loaded with readShapePoly
  command of maptools package?
 For example, the following code loads the shapefile containing
  Brazilian states division:
   library(maptools)br-readShapePoly(BR-map/3.shp)
 What I need to do is create a vector which contains all lat and
  lon values inside this shapefile...
 Thanks in advance,
 Thiago Veloso.
  
  
  
   [[alternative HTML version deleted]]
  
   ___
   R-sig-Geo mailing list
   r-sig-...@stat.math.ethz.ch
   https://stat.ethz.ch/mailman/listinfo/r-sig-geo
 
 


[[alternative HTML version deleted]]

 ___
 R-sig-Geo mailing list
 r-sig-...@stat.math.ethz.ch
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Extract a 'data.frame$column' column name

2010-05-03 Thread Rodrigo Aluizio
Well, it's may not be the best way to do so, but you may use this:

colnames(foo[n])

where n is the column number, or the column name inside '' ''.

The $ can't be used because it turn the column content into a vector,
loosing its properties (e.g.: column and row names). But when you using
[], these data.frame properties are preserved, so you can extract them.

Hope this helps.

Rodrigo.

2010/5/3 adrien Penac farfel...@yahoo.fr

 Hello,
  I can't find how to get de column name from a data.frame dollar reference.

 To make it simple, I'd like to obtain Bar from a foo$Bar notation.
 I've tried col.names(foo$Bar), names(foo$Bar) and so on without sucess.

 Regards

 Blaise




[[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] add euro sign to a plot

2010-03-21 Thread Rodrigo Aluizio
Hi Martin, here as example code that may help you to get what you want (once
you didn't specified were in the plot you want the symbol).

plot(1:10)
title(main= \u20ac, font = 5)

Ps.: This coding may differ between operational system, this one worked in a
Windows Vista 32 bits.
This works for all (I guess) the special character present in the windows
Character Map, just copy the code and use as \SymbolCode.

Hope it helps.

Rodrigo.

2010/3/21 Martin Batholdy batho...@googlemail.com

 hi,

 Is it possible to add special characters like the euro sign to a plot?

 thanks!

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] WMF conversion...

2010-02-10 Thread Rodrigo Aluizio
Or maybe another output image format, such as tiff or png?

2010/2/10 Uwe Ligges lig...@statistik.tu-dortmund.de



 On 10.02.2010 13:16, Jason Rupert wrote:

 Hello R-Help,

 I've got a bit of an issue with WMF's.   I am working on WindowsXP and
 outputting WMF format images.   I then take the WMF format images and insert
 them in PowerPoint.   I take the PowerPoint and convert it to PDF.

 The WMFs are nothing special.  Just the typical x-y plot with a gray
 dotted grid added and a few matlines.  The WMFs, when produced look great!
 They show all the necessary detail.

 Unfortunately, after placed in the PowerPoint and the PowerPoint is
 converted to PDF via MS Office's built in conversion utility, the resulting
 image have diagonal streaks across them from the y-axis down to the x-axis.
  The rest of the document is perfect, but the WMF images now have streaks
 across them.  It looks like it may be caused, somehow, by the dotted grid.

 I am locked into the workflow where I must place images in a PowerPoint
 and then convert it to PDF, so is there a different image format I should
 use or is there and intermediate step I need to use so that the streaks do
 not appear?

 Thanks for any feedback and insight.



 Use another converter to PDF?

 Uwe Ligges



  Jason

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Edit a Sptial Lines Object

2010-01-27 Thread Rodrigo Aluizio
at the end of an object (attached) component (BP[1]).

But I’m not able to do so. I can’t isolate the coordinates, if I use the
�...@lines” it turns into a list, but I need to keep the SpatialLines and S4
structure, then I will be able to transform the closed lines into polygons.

So, How can I insert the coordinates that will close the BP[1] line into
this object without changing the object properties. Any Ideas?

Thank you in advance.

 

-

MSc. Rodrigo Aluizio mailto:r.alui...@gmail.com 

Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Embed Fonts in All EPS files inside a Directory

2009-12-22 Thread Rodrigo Aluizio
Hi List, I would like to embed some fonts (AFM format) on 324 eps files
produced by a R loop, I’m able to do so one-by-one with the following
command:

 

embedFonts('C:/Users/Rodrigo/Documents/UFPR/Micropaleontologia/Potiguar/Cata
logo/Mapas/EPS/Example.eps',

outfile='C:/Users/Rodrigo/Documents/UFPR/Micropaleontologia/Potiguar/Catalog
o/Mapas/EPS/Example2.eps',

fontpaths=C:/Users/Rodrigo/Documents/UFPR/Micropaleontologia/Potiguar/Catal
ogo/ArialNarrow)

 

But, I would like to do that for the entire EPS directory at once. How can I
do so? Another issue is the fact that GhostScript 8.64 seems not to be able
of dealing with filenames larger than 8 character (the older Windows format,
error: no such file or directory), or with files inside folders with names
containing some types of characters (e.g.: ç, á, é, etc, non ASII, I
guess…). Well I fixed the directory name issue, but my 324 eps files have
species names, so they are pretty large names.

 

Well, if you have any ideas about the embed at once processes it may be
enough, I’ll try to figure out a way through the filename issue (which is
probably an GhostScript, not R, issue. But interestingly, when GIMP is using
GhostScript to render eps files, there aren’t problems with the files or
directories names!?!). GIMP 2.6.7 uses the GS_PROG environmental variable,
which leads to the same exe file of the R_GSCMD variable (gswin32c.exe)

 

Thank you for your attention, I hope you may help me.

 

Below are my session details:

I execute R as admin on a Windows Vista Home Premium SP2

I’ve set up the R_GSCMD environment variable accordingly

 

R version 2.10.1 (2009-12-14) 

i386-pc-mingw32 

 

locale:

[1] LC_COLLATE=Portuguese_Brazil.1252  LC_CTYPE=Portuguese_Brazil.1252   

[3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C  

[5] LC_TIME=Portuguese_Brazil.1252

 

attached base packages:

[1] grDevices datasets  splines   graphics  stats tcltk utils

[8] methods   base 

 

other attached packages:

[1] svSocket_0.9-48 TinnR_1.0.3 R2HTML_1.59-1   Hmisc_3.7-0

[5] survival_2.35-8

 

loaded via a namespace (and not attached):

[1] cluster_1.12.1  grid_2.10.1 lattice_0.17-26 svMisc_0.9-56  

[5] tools_2.10.1   

 

-

MSc.  mailto:r.alui...@gmail.com Rodrigo Aluizio

Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Cochran C Test - Homogeneity of Variances

2009-12-08 Thread Rodrigo Aluizio
Hi List.

It may be a very simple question, but I couldn’t find an answer on the
internet. Which function (maybe in a specific package) would I use to
perform a Cochran C Test for Homogeneity of Variances?

Stats package have the mantelhaen.test, but I’m “almost sure” that It’s not
what I want, it’s probably the Cochran Q Test.

So, any ideas?

Thank you for the pacience.

 

-

MSc.  mailto:r.alui...@gmail.com Rodrigo Aluizio

Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Rarefaction Curve by Individuals not Sites - vegan (specaccum)

2009-11-13 Thread Rodrigo Aluizio
Hi List,

I’m using  the vegan function specaccum to produce a rarefaction curve. In
the function’s help it says: “Function ‘specaccum’ finds species
accumulation curves or the number of species for a certain number of sampled
sites or individuals”. Well, I would like to finds this curve for
individuals, but when I compute it the function (using the ‘rarefaction’
method) gives me Sites, Richness and Standand Deviation as values. When I
plot it, y axis is the richness (ok with that) and x axis is Sites (here is
the question), how could I make it calculate and plot the accumulating
individuals number?

Well, one problem may be the fact that my data frame has species as columns
and Sites as rows (and abundance data frame)… May you help me?

 

Ps.: The ‘rarefaction’ method option brings this details: “All these methods
are based on sampling sites without replacement. In contrast, the ‘method =
rarefaction’ finds the expected species richness and its standard
deviation by sampling individuals instead of sites”. Exactly what I really
want, but not what I get!

 

Here is the command line used.

plot(specaccum(Spp[,-227],'rarefaction'),col='black',lwd=2,ci.lty=0,ci.type=
'poly',ci.col='lightgray',ylab='Riqueza',ylim=c(0,250),yaxp=c(0,250,10),bty=
'n',main='Fauna Viva - Bacia de Campos - Março 2009')

 

Thank you very much.

Regards.

 

-

MSc.  mailto:r.alui...@gmail.com Rodrigo Aluizio

Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RES: Plot

2009-10-06 Thread Rodrigo Aluizio
This may work for you.
Then you can custom your graphics with ?par.

Data-as.data.frame(matrix(c(Monday, Tuesday, Wed, Thu, Fri,
Sat,Sun,56,57,60,75,62,67,70,76,77,81,95,82,77,83),ncol=3,nrow=7,list(pa
ste('Row',1:7,sep=''),c('Days','Hum','Temp')),byrow=F))

plot(Data$Days,Data$Temp)

-Mensagem original-
De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em
nome de Ashta
Enviada em: terça-feira, 6 de outubro de 2009 11:36
Para: Sarah Goslee
Cc: R help
Assunto: Re: [R] Plot

Thanks Sara,

Yes I did try. I could not get the Days on the X-axis

blow is theerror message

plot(Temp,Days)
Error in plot.window(...) : need finite 'ylim' values
In addition: Warning messages:
1: In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion
2: In min(x) : no non-missing arguments to min; returning Inf
3: In max(x) : no non-missing arguments to max; returning -Inf




On Tue, Oct 6, 2009 at 10:19 AM, Sarah Goslee sarah.gos...@gmail.comwrote:

 Did you try it? With, perhaps, plot() ? And lines() ?

 You might do better with Days as a factor with the day names in order.
(And
 why are two full and five abbreviated?)

 I don't understand why Hum and Temp are matrices rather than vectors,
 and why then you didn't specify dimensions, and for that matter why you
 are missing a closing paren but do have a comma in its place.

 Generally this list is happy to help, but we like some evidence that the
 querent has *tried* before inquiring.

 Sarah

 On Tue, Oct 6, 2009 at 10:05 AM, Ashta sewa...@gmail.com wrote:
  Hi All,
 
 
  Days - matrix(c(Monday, Tuesday, Wed, Thu, Fri, Sat,
  Sun),7,1)
 
  Hum -matrix(c(56,57,60,75,62,67,70),
 
  Temp-matrix(c(76,77,81,95,82,77,83),
 
 
 
  Using the above information I want plot humidity and temperature on
 Y-axis
  and days on X-axis
 
  Any help is appreciated!
 

 --
 Sarah Goslee
 http://www.functionaldiversity.org


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RES: RES: Plot

2009-10-06 Thread Rodrigo Aluizio
Oh yeah, I forgot that, just correct this by:

Data-as.data.frame(matrix(c(Monday, Tuesday, Wed, Thu,
Fri,Sat,Sun,56,57,60,75,62,67,70,76,77,81,95,82,77,83),ncol=3,nrow=7,l
ist(paste('Row',1:7,sep=''),c('Days','Hum','Temp')),byrow=F))
Data$Hum-as.numeric(Data$Hum)
Data$Temp-as.numeric(Data$Temp)

Then you can plot it.

-Mensagem original-
De: joris meys [mailto:jorism...@gmail.com] 
Enviada em: terça-feira, 6 de outubro de 2009 12:08
Para: Rodrigo Aluizio
Assunto: Re: [R] RES: Plot

On Tue, Oct 6, 2009 at 4:56 PM, Rodrigo Aluizio r.alui...@gmail.com wrote:
 This may work for you.
 Then you can custom your graphics with ?par.

 Data-as.data.frame(matrix(c(Monday, Tuesday, Wed, Thu, Fri,

Sat,Sun,56,57,60,75,62,67,70,76,77,81,95,82,77,83),ncol=3,nrow=7,list(pa
 ste('Row',1:7,sep=''),c('Days','Hum','Temp')),byrow=F))
This won't work, as it puts also Temp en Hum as factors. A matrix can
only have 1 mode, and the matrix call you do converts everything to
factor before you put it in the dataframe.


 plot(Data$Days,Data$Temp)

 -Mensagem original-
 De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em
 nome de Ashta
 Enviada em: terça-feira, 6 de outubro de 2009 11:36
 Para: Sarah Goslee
 Cc: R help
 Assunto: Re: [R] Plot

 Thanks Sara,

 Yes I did try. I could not get the Days on the X-axis

 blow is theerror message

 plot(Temp,Days)
 Error in plot.window(...) : need finite 'ylim' values
 In addition: Warning messages:
 1: In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion
 2: In min(x) : no non-missing arguments to min; returning Inf
 3: In max(x) : no non-missing arguments to max; returning -Inf




 On Tue, Oct 6, 2009 at 10:19 AM, Sarah Goslee
sarah.gos...@gmail.comwrote:

 Did you try it? With, perhaps, plot() ? And lines() ?

 You might do better with Days as a factor with the day names in order.
 (And
 why are two full and five abbreviated?)

 I don't understand why Hum and Temp are matrices rather than vectors,
 and why then you didn't specify dimensions, and for that matter why you
 are missing a closing paren but do have a comma in its place.

 Generally this list is happy to help, but we like some evidence that the
 querent has *tried* before inquiring.

 Sarah

 On Tue, Oct 6, 2009 at 10:05 AM, Ashta sewa...@gmail.com wrote:
  Hi All,
 
 
  Days - matrix(c(Monday, Tuesday, Wed, Thu, Fri, Sat,
  Sun),7,1)
 
  Hum -matrix(c(56,57,60,75,62,67,70),
 
  Temp-matrix(c(76,77,81,95,82,77,83),
 
 
 
  Using the above information I want plot humidity and temperature on
 Y-axis
  and days on X-axis
 
  Any help is appreciated!
 

 --
 Sarah Goslee
 http://www.functionaldiversity.org


        [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Change the Order of a Cluster Topology

2009-08-30 Thread Rodrigo Aluizio
Hi list, recently, for didactic reasons, I had the need to change a cluster
topology (just the order of my groups, defined in an height of choice), not
the results, obviously. Well I’m looking at hclust or agnes (cluster
package) objects for something that defines the line breakings of the
graphics, so I could try something to change this plot ordering. But, I’m
unable to figure that out.

Is there a way to do so?

 

Here is an example code:

 

Spp-matrix(rnorm(1:750,mean=10,sd=2),ncol=15,nrow=50,list(c(paste('Spp',1:5
0,sep='')),c(paste('C',1:15,sep=''))),byrow=T)

Ward-hclust(dist(Spp),method='ward')

plot(Ward)

 

Let’s suppose I want to change the order of the groups formed at the height
of 20 (Obviously, only where it’s possible, without altering the greater
groups composition).

Is it possible?

 

-

MSc.  mailto:r.alui...@gmail.com Rodrigo Aluizio

Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - Brasil




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Best R text editors?

2009-08-30 Thread Rodrigo Aluizio
Well, on Linux = Emacs+ Ess
On Windows = Tinn-R

-
MSc. Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] ENC: postscript, options

2009-08-18 Thread Rodrigo Aluizio
I'm not shure but I guess that you miss a  and putted it in the wrong
place!
Try this: postscript(/pathto/filename.eps,horizontal=FALSE,onefile=FALSE)

Hope It helps.

-Mensagem original-
De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em
nome de e-letter
Enviada em: segunda-feira, 17 de agosto de 2009 10:11
Para: r-help@r-project.org
Assunto: [R] postscript, options

Readers,

I am not able to create a postscript file with the following command:

postscript(/pathto/filename.eps,horizontal=FALSE,onefile=FALSE)

A file is not created, instead the command terminal shows the plus
sign(+) on a new line:

+

What does this mean please?

rh...@conference.jabber.org
mandriva 2008
r 251 (27-06-07)

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to Import Excel file into R 2.9.0 version

2009-08-11 Thread Rodrigo Aluizio
Hi, take a look at the gdata package (any plataform) function read.xls(),
and at the package RODBC (if you are on a Windows Plataform) at the
functions odbcConnectExcel(), odbcConnectExcel2007() and sqlFetch().

Hope this helps

Rodrigo.

2009/8/11 rajclinasia r...@clinasia.com


 Hi Every one,
 I have a problem with Reading Excel file into R 2.9.0 version. In older
 versions it is working with xlsReadWrite package. But in 2.9.0 version
 there is no package like that. so help me out in this aspect.

 Thanks in Advance.
 --
 View this message in context:
 http://www.nabble.com/How-to-Import-Excel-file-into-R-2.9.0-version-tp24914638p24914638.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RES: Saving plots to file

2009-08-10 Thread Rodrigo Aluizio
You can save plots as specified below. For details see ?png, ?postscrip,
?tiff, ?jpeg, ?bmp.

postscript(file = ifelse(onefile, Rplots.ps, Rplot%03d.ps),
   onefile, family, title, fonts, encoding, bg, fg,
   width, height, horizontal, pointsize,
   paper, pagecentre, print.it, command,
   colormodel, useKerning)
bmp(filename = Rplot%03d.bmp, width = 480, height = 480,
units = px, pointsize = 12, bg = white, res = NA,
restoreConsole = TRUE)
jpeg(filename = Rplot%03d.jpg, width = 480, height = 480,
 units = px, pointsize = 12, quality = 75, bg = white,
 res = NA, restoreConsole = TRUE)
png(filename = Rplot%03d.png, width = 480, height = 480,
units = px, pointsize = 12, bg = white, res = NA,
restoreConsole = TRUE)
tiff(filename = Rplot%03d.tif, width = 480, height = 480,
 units = px, pointsize = 12,
 compression = c(none, rle, lzw, jpeg, zip),
 bg = white, res = NA,
 restoreConsole = TRUE)


-Mensagem original-
De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em
nome de Sean MacEachern
Enviada em: segunda-feira, 10 de agosto de 2009 13:26
Para: r-help@r-project.org
Assunto: [R] Saving plots to file

Appologies if this has been addressed before, but I can't seem to find it in
the help archives.

I'm looking to do something like the following but it looks like save.plot
is deprecated.

save.plot(plot(glm1$residuals,gain,main = Hist of residuals and
gain),file=Desktop/hist1.png)


Thanks in advance,

Sean

Session Info:

R version 2.9.1 (2009-06-26)
i386-apple-darwin8.11.1

locale:
en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

loaded via a namespace (and not attached):
[1] tools_2.9.1

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Import xlsx file in Ubuntu 9.04

2009-07-08 Thread Rodrigo Aluizio
Hi list,
By the entire last 2 weeks I was looking for a way to directly import xlsx
files to R in a Linux OS (Ubuntu 9.04). I already read the R Import/Export
guide, and I know how to use gdata to import xls files and read.table to
import .csv. My problem is that all data that I receive is in the xlsx
format, and I have to convert all the files to xls.
Well, when I was using Windows Vista OS, RODBC did the trick with the
odbcConnectExcel2007 function (which I know is not present in the Linux
RODBC package, probably due to drivers issue). Isn't there a way to import
this xlsx files directly to R without any previous conversion (.csv or
.xls)?

Thank you for the attention, it's probable that some one already asked it. I
even remember seen that somewhere, but without a definitive answer.

Rodrigo.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] RODBC: Trying to read an Excel file

2009-06-25 Thread Rodrigo Aluizio
Try the function sqlFetch to import the data in the spreadsheet.

jo-odbcConnectExcel(i:\\all\\sorkinjohn\\stats\\silvermannatalie\\NEMOcomb
ined06-24-09.xls,readOnly = TRUE)
mo-sqlFetch(jo,'Your Sheet Name or Number',colnames=F,rownames=F)
mo

Hope it helps.


-
MSc. Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - Brasil


-Mensagem original-
De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em
nome de John Sorkin
Enviada em: quinta-feira, 25 de junho de 2009 08:21
Para: r-help@r-project.org
Assunto: [R] RODBC: Trying to read an Excel file

R 2.8
Windows XP
Excel 2003

I am trying to read an Excel spread sheet. I have looked at the RODBC help
pages and am having trouble setting up code that will work. My code and the
results are pasted below:



jo-odbcConnectExcel(i:\\all\\sorkinjohn\\stats\\silvermannatalie\\NEMOcomb
ined06-24-09.xls,readOnly = TRUE)
 mo-sqlGetResults(jo)
 mo
[1] -1

I have tried to set up the connection string using odbcConnectExcel and then
have tried to read the file using sqlGetResults. Can someone tell me what I
am doing wrong?

Thanks,
John

John David Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax) 410-605-7913 (Please call phone number above prior to faxing)

Confidentiality Statement:
This email message, including any attachments, is for th...{{dropped:9}}

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Post-Hoc Test for Kruskal-Wallis Rank Sum Test

2009-06-19 Thread Rodrigo Aluizio
Hi list,

I would like to know if there is a way in R to execute a post-hoc test
(factor levels comparison, like Tukey for ANOVA) of a non-parametric
analysis of variance (kruskal.test() function object). I was looking for
something like the Dunn Test. I’ve searched the internet but nothing seemed
to define a way to it.

 

Do You have any suggestion? Other equivalent test maybe!

 

Thanks in advance.

 

-

MSc.  mailto:r.alui...@gmail.com Rodrigo Aluizio

Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - Brasil
Fone: (41) 3511-8617

Fax: (41) 3455-3623




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Post-Hoc Test for Kruskal-Wallis Rank Sum Test

2009-06-19 Thread Rodrigo Aluizio
Thank you so much Gilles, that is exactly what I’m looking for.

 

Rodrigo.

 

De: LE PAPE Gilles [mailto:lepape.gil...@neuf.fr] 
Enviada em: sexta-feira, 19 de junho de 2009 10:14
Para: r.alui...@gmail.com
Assunto: Post-hoc test

 

Hi Rodrigo,

you can use the nparcomp function, library(nparcomp).

Gilles LE PAPE
AnaStats
14, rue de la Bretonnerie
37000 TOURS
Tél. 02 47 05 87 59
Courriel : lepape.gil...@neuf.fr
www.anastats.fr


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Bubble Plot Over a Map

2009-05-07 Thread Rodrigo Aluizio
Hi everybody,

Well here is another doubt! I’m elaborating some maps, and I pretend to plot
over it the abundance of species. I could do that using points(), but I’d
like to use bubble() from sp package.

When trying to use bubble() I face the fallowing issue: When I call the
bubble function it overwrite everything I previously plotted. It doesn’t
happen with points (obviously), only with bubble(). I tried to specify
panel.smooth as panel function to bubble, I tried to use add=T as argument,
but it didn’t accept such thing.

The only thing that I thought right now, so I still have to try, is saving
the bubble() as an object and try to manipulate its properties over my map.

I already searched the list posts but wasn’t able to find a similar doubt
with its possible solutions.

 

Bellow is the map code using points, I’m trying to substitute the points()
functions with one bubble() function.

 

for (i in 1:length(colnames(Spp10ml))) {

png(paste(colnames(Spp10ml),'.png',sep='')[i],width=5.2,height=3.6,pointsize
=5,units='in',bg=NA,restoreConsole=T,res=1200)

par(mar=c(5,0,0,0))

map('worldHires','brazil',ylim=c(-5.15,-4.55),xlim=c(-37,-36.1),type='n')

rect(-37.1,-5.25,-36,-4.9,density=NULL,angle=45,col='#dbf4ff',border=F)

plot(Batimetria,ylab='',xlab='',border=F,col=Cor$Cor,add=T)

plot(Municipios,ylab='',xlab='',col=rgb(245,232,140,max=255,alpha=255),add=T
,lwd=0.2)

axis(1,xaxp=c(-37,-36.1,5),cex.axis=1.5)

axis(2,yaxp=c(-5.15,-4.55,5),cex.axis=1.5)

text(Prof$Long,Prof$Lat,rownames(Prof),col='black',cex=1.2,srt=-24,family='A
R',font=2)

text(c(-36.96,-36.96,-36.865,-36.54,-36.37,-36.2),c(-4.96,-5.05,-5.11,-5.14,
-5.14,-5.14),c('Areia

Branca','Serra

do Mel','Porto do
Mangue','Macau','Guamaré','Galinhos'),col='Black',cex=1.3,font=2)

rect(-36.20,-4.56,-36.155,-4.565,density=NULL,angle=45,col='black',border='b
lack',lwd=0.1)

rect(-36.155,-4.56,-36.111,-4.565,density=NULL,angle=45,col='white',border='
black',lwd=0.1)

shadowtext(c(-36.20,-36.155,-36.111,-36.215),c(-4.573,-4.573,-4.573,-4.562),
c('0','5','10','km'),col='white',cex=1)

Norte(-36.155,-4.60,0.02)

box(which='plot',lty='solid')

points(Pontos$long[Spp10ml[,i]0  Spp10ml[,i]=50],Pontos$lat[Spp10ml[,i]0
 Spp10ml[,i]=50],pch=21,bg=rgb(70,70,70,max=255,alpha=255),col=
'black',cex=1.5)

points(Pontos$long[Spp10ml[,i]=51 
Spp10ml[,i]=200],Pontos$lat[Spp10ml[,i]=51 
Spp10ml[,i]=200],pch=23,bg='yellow',col='black',cex=1.5)

points(Pontos$long[Spp10ml[,i]=201 
Spp10ml[,i]=400],Pontos$lat[Spp10ml[,i]=201 
Spp10ml[,i]=400],pch=22,bg='orange',col='black',cex=1.5)

points(Pontos$long[Spp10ml[,i]=401],Pontos$lat[Spp10ml[,i]=401],pch=24,bg=
'red',col='black',cex=1.5)

dev.off()}

 

Thanks in advance.

 

-

MSc.  mailto:r.alui...@gmail.com Rodrigo Aluizio

Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - Brasil




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Text Contrast in a Plot

2009-04-24 Thread Rodrigo Aluizio
Hi List,

I would appreciate any suggestion on how can I make a text I’ve inserted in
a plot show some contrast? With this I mean that I have a white text on a
plot and I would like to make a tiny border around it in black, so even
being small sized and the entire graphic being small in the text page I’ll
insert it. It will be visible.

 

Well I tried inserting a box() function inside the text() function, R
accepts the command but there is no effect. I even tried to plot a greater
black text and then a smaller white one at the same place, but it doesn’t
look good.

 

Any ideas!

 

Bellow is my plot code without the above mentioned attempts. I’d like to add
this effect at the second text() command.

 

png('BaseMap.png',width=5.2,height=3.6,pointsize=5,units='in',bg=NA,restoreC
onsole=T,res=1200)

par(mar=c(5,0,0,0))

map('worldHires','brazil',ylim=c(-5.15,-4.55),xlim=c(-37,-36.1),type='n')

rect(-37.1,-5.25,-36,-4.9,density=NULL,angle=45,col='#dbf4ff',border=F)

plot(Batimetria,ylab='',xlab='',border=F,col=Cor$Cor,add=T)

plot(Municipios,ylab='',xlab='',col=rgb(245,232,140,max=255,alpha=255),add=T
,lwd=0.2)

axis(1,xaxp=c(-37,-36.1,5),cex.axis=1.5)

axis(2,yaxp=c(-5.15,-4.55,5),cex.axis=1.5)

text(Prof$Long,Prof$Lat,rownames(Prof),col='black',cex=0.9,srt=-24,font=2)

text(c(-36.96,-36.96,-36.865,-36.54,-36.37,-36.2),c(-4.96,-5.05,-5.11,-5.14,
-5.14,-5.14),c('Areia

Branca','Serra

do Mel','Porto do
Mangue','Macau','Guamaré','Galinhos'),col='Black',cex=1.3,font=2)

rect(-36.20,-4.56,-36.155,-4.565,density=NULL,angle=45,col='black',border='b
lack',lwd=0.1)

rect(-36.155,-4.56,-36.111,-4.565,density=NULL,angle=45,col='white',border='
black',lwd=0.1)

text(c(-36.20,-36.155,-36.111,-36.215),c(-4.573,-4.573,-4.573,-4.562),c('0',
'5','10','km'),col='white',cex=1)

Norte(-36.155,-4.60,0.02)

box(which='plot',lty='solid')

dev.off()

 

Thanks in advance!

 

-

MSc.  mailto:r.alui...@gmail.com Rodrigo Aluizio

Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR – Brasil


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RES: Text Contrast in a Plot

2009-04-24 Thread Rodrigo Aluizio
Thanks very much Greg and Mark for your attention.
The function that Greg created did the trick perfectly.
Once more thank you, I'll never be able to figure it out by myself, at least
not in time.
I'm still unable to write my own functions, but I'm working on it.

Rodrigo.

-Mensagem original-
De: Greg Snow [mailto:greg.s...@imail.org] 
Enviada em: sexta-feira, 24 de abril de 2009 18:23
Para: Rodrigo Aluizio; R Help
Assunto: RE: [R] Text Contrast in a Plot

Try this function as one approach:

shadowtext - function(x, y=NULL, labels, col='white', bg='black',
theta= seq(pi/4, 2*pi, length.out=8), r=0.1, ... ) {

xy - xy.coords(x,y)
xo - r*strwidth('A')
yo - r*strheight('A')

for (i in theta) {
text( xy$x + cos(i)*xo, xy$y + sin(i)*yo, labels, col=bg,
... )
}
text(xy$x, xy$y, labels, col=col, ... )
}

And here is an example of use:

plot(1:10, 1:10, bg='aliceblue')
rect(3,3,5,8, col='navy')
text(5,6, 'Test 1', col='lightsteelblue')
shadowtext(5,4, 'Test 2', col='lightsteelblue')

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
 project.org] On Behalf Of Rodrigo Aluizio
 Sent: Friday, April 24, 2009 8:12 AM
 To: R Help
 Subject: [R] Text Contrast in a Plot
 
 Hi List,
 
 I would appreciate any suggestion on how can I make a text I've
 inserted in a plot show some contrast? With this I mean that I have a
 white text on a plot and I would like to make a tiny border around it
 in black, so even being small sized and the entire graphic being small
 in the text page I'll insert it. It will be visible.
 
 
 
 Well I tried inserting a box() function inside the text() function, R
 accepts the command but there is no effect. I even tried to plot a
 greater black text and then a smaller white one at the same place, but
 it doesn't look good.
 
 
 
 Any ideas!
 
 
 
 Bellow is my plot code without the above mentioned attempts. I'd like
 to add this effect at the second text() command.
 
 
 
 png('BaseMap.png',width=5.2,height=3.6,pointsize=5,units='in',bg=NA,res
 toreC
 onsole=T,res=1200)
 
 par(mar=c(5,0,0,0))
 
 map('worldHires','brazil',ylim=c(-5.15,-4.55),xlim=c(-37,-
 36.1),type='n')
 
 rect(-37.1,-5.25,-36,-4.9,density=NULL,angle=45,col='#dbf4ff',border=F)
 
 plot(Batimetria,ylab='',xlab='',border=F,col=Cor$Cor,add=T)
 
 plot(Municipios,ylab='',xlab='',col=rgb(245,232,140,max=255,alpha=255),
 add=T
 ,lwd=0.2)
 
 axis(1,xaxp=c(-37,-36.1,5),cex.axis=1.5)
 
 axis(2,yaxp=c(-5.15,-4.55,5),cex.axis=1.5)
 
 text(Prof$Long,Prof$Lat,rownames(Prof),col='black',cex=0.9,srt=-
 24,font=2)
 
 text(c(-36.96,-36.96,-36.865,-36.54,-36.37,-36.2),c(-4.96,-5.05,-5.11,-
 5.14,
 -5.14,-5.14),c('Areia
 
 Branca','Serra
 
 do Mel','Porto do
 Mangue','Macau','Guamaré','Galinhos'),col='Black',cex=1.3,font=2)
 
 rect(-36.20,-4.56,-36.155,-
 4.565,density=NULL,angle=45,col='black',border='b
 lack',lwd=0.1)
 
 rect(-36.155,-4.56,-36.111,-
 4.565,density=NULL,angle=45,col='white',border='
 black',lwd=0.1)
 
 text(c(-36.20,-36.155,-36.111,-36.215),c(-4.573,-4.573,-4.573,-
 4.562),c('0',
 '5','10','km'),col='white',cex=1)
 
 Norte(-36.155,-4.60,0.02)
 
 box(which='plot',lty='solid')
 
 dev.off()
 
 
 
 Thanks in advance!
 
 
 
 -
 
 MSc.  mailto:r.alui...@gmail.com Rodrigo Aluizio
 
 Centro de Estudos do Mar/UFPR
 Laboratório de Micropaleontologia
 Avenida Beira Mar s/n - CEP 83255-000
 Pontal do Paraná - PR - Brasil
 
 
   [[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RES: How to force axis to have the same range

2009-04-20 Thread Rodrigo Aluizio
Hi Sebastien, take a look at the par(pty='s') argument. Maybe its can solve
your issue.

Best wishes.

Rodrigo.

-Mensagem original-
De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em
nome de Sebastien Bihorel
Enviada em: segunda-feira, 20 de abril de 2009 12:26
Para: R-help
Assunto: [R] How to force axis to have the same range

Dear R-users,

I am trying to produce (standard and trellis) scatterplots which use the 
same range of the x and y axes. In addition, I would like the plots to 
be physically square. Is there one or more specific argument(s) to plot 
and xyplot what would do that? I have looked at various combinations of 
asp and pin value, but could not get what I wanted..

Thank you in advance for your help

Sebastien

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RES: Plot Means Line with Standard Deviation as Whiskers

2009-03-24 Thread Rodrigo Aluizio
Thanks for the answer, I'll take a look at these, meanwhile I forged some
data as an example of what I'll have soon.

Sam.Vol.
A1R179,40
A1R2102,09
A1R3102,09
A2R1124,78
A2R2158,81
A2R3153,13
A3R1226,87
A3R2164,48
A3R3153,13
A4R1181,49
A4R2175,82
A4R3170,15
A5R1175,82
A5R2175,82
A5R3289,25
B1R1119,10
B1R2204,18
B1R3232,54
B2R1164,48
B2R2113,43
B2R3130,45
B3R1102,09
B3R2107,76
B3R3107,76
B4R1136,12
B4R2158,81
B4R3198,51
C1R176,30
C1R270,65
C1R362,17
C2R176,30
C2R270,65
C2R373,48
C3R150,87
C3R284,78
C3R3110,21
C4R1141,79
C4R2175,82
C4R3102,09
C5R190,43
C5R2113,04
C5R3141,30
D1R162,17
D1R242,39
D1R353,69
D2R167,82
D2R267,82
D2R359,35
D4R168,06
D5R1153,13
D5R2119,10
D5R3119,10
E1R1141,79
E1R285,07
E1R3107,76
E2R1130,45
E2R2175,82
E2R3107,76
E5R1158,81
F1R151,04
F1R290,75
F1R385,07
F2R173,73
F2R268,06
F2R373,73
F3R134,03
F3R239,70
F3R339,70
F4R139,70
F4R239,70
F4R351,04
G1R190,75
G1R262,39
G2R168,06
G2R279,40
G2R385,07
G3R1158,81
G3R2158,81
G3R3158,81
G5R145,37
G5R239,70
G5R351,04
H1R145,37
H1R2102,09
H1R345,37
H2R117,01
H2R222,69
H2R322,69
H3R168,06
H3R268,06
H3R345,37
H4R151,04
H4R245,37
H4R385,07
H5R156,72
H5R279,40
H5R373,73
I1R185,07
I1R273,73
I1R368,06
I2R1141,79
I2R2119,10
I2R3119,10
I3R173,73
I4R162,39
I4R245,37
I4R373,73
I5R1204,18
I5R2158,81
I5R3181,49

-Mensagem original-
De: Peter Alspach [mailto:palsp...@hortresearch.co.nz] 
Enviada em: segunda-feira, 23 de março de 2009 19:55
Para: Rodrigo Aluizio; R Help
Assunto: RE: [R] Plot Means Line with Standard Deviation as Whiskers

Tena koe Rodrigo

You could always make up some data and then show us what you have tried to
do.  I would guess you need to check out:

plot # to do the basic plot
lines # to add lines to the plot
points # to add points to the plot
arrows # can be used to give the whiskers
apply # to get the means and standard deviations

HTH 

Peter Alspach

 -Original Message-
 From: r-help-boun...@r-project.org 
 [mailto:r-help-boun...@r-project.org] On Behalf Of Rodrigo Aluizio
 Sent: Tuesday, 24 March 2009 11:44 a.m.
 To: R Help
 Subject: [R] Plot Means Line with Standard Deviation as Whiskers
 
 Hi list members.
 
 I'll try to plot the abundance means of nine transects as 
 lines, with five points on each transect (A to I). I will 
 also need to plot for each point, it's standard deviation 
 (once each point will have tree replicates) as whiskers. 
 Another problem will be that all the points should exist for 
 each transect, but we know that six of the nine transects 
 will have blanks (A1, A2, A3, -, A5). So the line have to be 
 interrupted and can't induce an inexistent value by link A3 
 to A5 (an example).
 
  
 
 Well, unfortunately I still don't have the data, I'm just 
 anticipating a future situation, and I can't find any clear 
 suggestion by googling the issue, and I guess the help 
 files may have something but I was unable to find by myself.
 
  
 
 Thanks in advance. Any help will be appreciated.
 
  
 
 -
 
 MSc.  mailto:r.alui...@gmail.com Rodrigo Aluizio
 
 Centro de Estudos do Mar/UFPR
 Laboratório de Micropaleontologia
 Avenida Beira Mar s/n - CEP 83255-000
 Pontal do Paraná - PR - Brasil
 Fone: (0**41) 3455-3620 ramal 217
 Fax: (0**41) 3455-3623
 
 
 
 
   [[alternative HTML version deleted]]
 
 

The contents of this e-mail are confidential and may be ...{{dropped:15}}

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Plot Means Line with Standard Deviation as Whiskers

2009-03-23 Thread Rodrigo Aluizio
Hi list members.

I’ll try to plot the abundance means of nine transects as lines, with five
points on each transect (A to I). I will also need to plot for each point,
it’s standard deviation (once each point will have tree replicates) as
whiskers. Another problem will be that all the points should exist for each
transect, but we know that six of the nine transects will have blanks (A1,
A2, A3, -, A5). So the line have to be interrupted and can’t induce an
inexistent value by link A3 to A5 (an example).

 

Well, unfortunately I still don’t have the data, I’m just anticipating a
future situation, and I can’t find any clear suggestion by “googling” the
issue, and I guess the help files may have something but I was unable to
find by myself.

 

Thanks in advance. Any help will be appreciated.

 

-

MSc.  mailto:r.alui...@gmail.com Rodrigo Aluizio

Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - Brasil
Fone: (0**41) 3455-3620 ramal 217
Fax: (0**41) 3455-3623




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RES: set a legend with an image graph

2009-03-17 Thread Rodrigo Aluizio
Luis, take a look at the ?legend function, it can produce almost any kind of
legend you may need!

Hope It helps.

Rodrigo.

-Mensagem original-
De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em
nome de Luis Ridao Cruz
Enviada em: terça-feira, 17 de março de 2009 11:09
Para: r-h...@stat.math.ethz.ch
Assunto: [R] set a legend with an image graph

R-help,

I have an image plot and I wish to set a legend to it
but I don't have an idea how to do it. Below it's the code line.

image(yyy, col = rev(heat.colors(10)), axes = T)

Thanks in advance.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] read.xls question

2009-03-15 Thread Rodrigo Aluizio
To turn the function avaliable you have to load the library first, to  
do so:


library(xlsReadWrite)
Then you use your command read.xls.
I'm suposing that you already had installed the xlsReadWrite package.

A better alternative to this package is RODBC, which also read excel  
2007 files. Take a look on it at the CRAN web site.


Hope it helps.
Best wishes.

__
Rodrigo Aluizio

Em 15/03/2009, às 00:27, Mathew, Abraham T amat...@ku.edu escreveu:

I'm an R newbie and had a question about the read.xls function. I've  
heard that this is often not a reliable function to use for  
importing data. However, I have created numerous xls files which  
contain information about voter turnout and macroeconomic indicators  
in India. I'm writing a paper on the relationship between economic  
growth and voter turnout.


This is the command I use:

data - read.xls(India.xls, header=TRUE)

I get the following error message:
Error: could not find function read.xls


Anyone have ideas?
Thanks,
Abraham



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RES: North Arrow (.png file) on a Map

2009-03-11 Thread Rodrigo Aluizio
Thanks a lot Yihui, It's perfect, in fact exactly identical the I have as a
png file in my computer.
Thank you so much.

Regards
Rodrigo

-Mensagem original-
De: Yihui Xie [mailto:xieyi...@gmail.com] 
Enviada em: quarta-feira, 11 de março de 2009 02:48
Para: Rodrigo Aluizio
Cc: R Help
Assunto: Re: [R] North Arrow (.png file) on a Map

Is this arrow satisfactory for you?

north.arrow = function(x, y, h) {
polygon(c(x, x, x + h/2), c(y - h, y, y - (1 + sqrt(3)/2) * h),
col = black, border = NA)
polygon(c(x, x + h/2, x, x - h/2), c(y - h, y - (1 + sqrt(3)/2) *
h, y, y - (1 + sqrt(3)/2) * h))
text(x, y, N, adj = c(0.5, 0), cex = 4)
}
plot(1, type = n, ylim = c(0, 1))
north.arrow(1, 0.8, 0.3)

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086
Mobile: +86-15810805877
Homepage: http://www.yihui.name
School of Statistics, Room 1037, Mingde Main Building,
Renmin University of China, Beijing, 100872, China



On Tue, Mar 10, 2009 at 7:21 PM, Rodrigo Aluizio r.alui...@gmail.com
wrote:
 Hi list.

 I would like to know how do I insert a North arrow, stored as a png file
in
 my computer, in a map? I found lots of post asking similar things, one of
 them mentioned the pixmap package.  The map was done using map() and
 shapefiles (the code is below). I’m using the pixmap () and addlogo()
 functions. Well I can import the png with pixmap() function (I guess, once
 there’s no error message), but I can’t put It on the map, I got an error
 message telling me that:



 “Error at t(x...@index[nrow(x...@index):1, , drop = FALSE]) :

  index out of limits”



 Well I tried changing coordinates but I always got the same result. How do
I
 do this correctly? Is there a better way?



 Thanks for the help and attention.



 Here is the complete map script:



 library(RODBC)

 library(maps)

 library(mapdata)

 library(maptools)

 library(pixmap)

 #Carregar Coordenadas e dados dos Pontos Amostrais

 Dados-odbcConnectExcel('Campos.xls',readOnly=T)

 Coord-sqlFetch(Dados,'CoordMed',colnames=F,rownames='Ponto')

 odbcClose(Dados)

 N-pixmap('Norte.png',nrow=166,ncol=113)

 # Carregar pontos e shapes


Batimetria-readShapeSpatial('C:/Users/Rodrigo/Documents/UFPR/Micropaleontol
 ogia/Campos/ShapeFiles/Batimetria_BC.shp')


Estados-readShapeSpatial('C:/Users/Rodrigo/Documents/UFPR/Micropaleontologi
 a/Campos/ShapeFiles/Estados_Sudeste.shp')


Faciologia-readShapeSpatial('C:/Users/Rodrigo/Documents/UFPR/Micropaleontol
 ogia/Campos/ShapeFiles/Faciologia_BC.shp')

 # Mapa com os Pontos da Bacia


postscript('MapaCampos.eps',paper='special',onefile=F,horizontal=F,width=3.5
 ,height=4.5,bg='white',pointsize=3)

 par(mar=c(3,2,2,0))

 map('worldHires','brazil',ylim=c(23.9,20.3),xlim=c(42.1,39.2),type='n')


plot(Faciologia,ylab='',xlab='',col=c('lightgreen','lightgreen','lightgreen'

,'lightgreen','lightgreen','lightgray','lightgray','lightgray','lightgray','

lightgray','lightgray','lightgray','lightgray','lightgray','lightgray','ligh

tgray','lightgray','lightgray','lightgray','lightgray','lightgray','lightyel
 low','lightyellow','lightyellow'),add=T,lwd=0.5,border=0)

 plot(Batimetria,ylab='',xlab='',col='darkgray',lty='solid',lwd=0.2,add=T)

 plot(Estados,ylab='',xlab='',lty='solid',add=T,lwd=0.8)


text(Coord$Longitude[Coord$Réplicas=='1'],Coord$Latitude[Coord$Réplicas=='1'
 ],rownames(Coord)[Coord$Réplicas=='1'],col='red',cex=0.5,font=2)


text(Coord$Longitude[Coord$Réplicas=='2'],Coord$Latitude[Coord$Réplicas=='2'
 ],rownames(Coord)[Coord$Réplicas=='2'],col='yellow',cex=0.5,font=2)


text(Coord$Longitude[Coord$Réplicas=='3'],Coord$Latitude[Coord$Réplicas=='3'
 ],rownames(Coord)[Coord$Réplicas=='3'],col='blue',cex=0.5,font=2)

 points(Coord$Longitude,Coord$Latitude-0.045,pch=20,cex=0.7)

 text(c(41.5,41.3),c(21.7,20.6),c('RJ','ES'))

 axis(1,xaxp=c(42.1,39.2,2),cex.axis=1)

 axis(2,yaxp=c(23.9,20.3,4),cex.axis=1)

 title(main='Bacia')


legend(40.2,23.5,c('Uma','Duas','Três'),pch=21,cex=1,pt.bg=c('red','yellow',
 'blue'),bty='n',pt.cex=2,pt.lwd=0.6,title='Réplicas')


legend(39.8,23.5,c('Areia','Calcário','Lama'),pch=21,cex=1,pt.bg=c('lightyel

low','lightgray','lightgreen'),bty='n',pt.cex=2,pt.lwd=0.6,title='Faciologia
 ')

 addlogo(N,px=c(40,39.8),py=c(21,20.8))

 dev.off()

 q('no')



 -

 MSc. Rodrigo Aluizio mailto:r.alui...@gmail.com

 Centro de Estudos do Mar/UFPR
 Laboratório de Micropaleontologia


        [[alternative HTML version deleted]]


 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org

[R] North Arrow (.png file) on a Map

2009-03-10 Thread Rodrigo Aluizio
Hi list.

I would like to know how do I insert a North arrow, stored as a png file in
my computer, in a map? I found lots of post asking similar things, one of
them mentioned the pixmap package.  The map was done using map() and
shapefiles (the code is below). I’m using the pixmap () and addlogo()
functions. Well I can import the png with pixmap() function (I guess, once
there’s no error message), but I can’t put It on the map, I got an error
message telling me that:

 

“Error at t(x...@index[nrow(x...@index):1, , drop = FALSE]) : 

  index out of limits”

 

Well I tried changing coordinates but I always got the same result. How do I
do this correctly? Is there a better way?

 

Thanks for the help and attention.

 

Here is the complete map script:

 

library(RODBC)

library(maps)

library(mapdata)

library(maptools)

library(pixmap)

#Carregar Coordenadas e dados dos Pontos Amostrais

Dados-odbcConnectExcel('Campos.xls',readOnly=T)

Coord-sqlFetch(Dados,'CoordMed',colnames=F,rownames='Ponto')

odbcClose(Dados)

N-pixmap('Norte.png',nrow=166,ncol=113)

# Carregar pontos e shapes

Batimetria-readShapeSpatial('C:/Users/Rodrigo/Documents/UFPR/Micropaleontol
ogia/Campos/ShapeFiles/Batimetria_BC.shp')

Estados-readShapeSpatial('C:/Users/Rodrigo/Documents/UFPR/Micropaleontologi
a/Campos/ShapeFiles/Estados_Sudeste.shp')

Faciologia-readShapeSpatial('C:/Users/Rodrigo/Documents/UFPR/Micropaleontol
ogia/Campos/ShapeFiles/Faciologia_BC.shp')

# Mapa com os Pontos da Bacia

postscript('MapaCampos.eps',paper='special',onefile=F,horizontal=F,width=3.5
,height=4.5,bg='white',pointsize=3)

par(mar=c(3,2,2,0))

map('worldHires','brazil',ylim=c(23.9,20.3),xlim=c(42.1,39.2),type='n')

plot(Faciologia,ylab='',xlab='',col=c('lightgreen','lightgreen','lightgreen'
,'lightgreen','lightgreen','lightgray','lightgray','lightgray','lightgray','
lightgray','lightgray','lightgray','lightgray','lightgray','lightgray','ligh
tgray','lightgray','lightgray','lightgray','lightgray','lightgray','lightyel
low','lightyellow','lightyellow'),add=T,lwd=0.5,border=0)

plot(Batimetria,ylab='',xlab='',col='darkgray',lty='solid',lwd=0.2,add=T)

plot(Estados,ylab='',xlab='',lty='solid',add=T,lwd=0.8)

text(Coord$Longitude[Coord$Réplicas=='1'],Coord$Latitude[Coord$Réplicas=='1'
],rownames(Coord)[Coord$Réplicas=='1'],col='red',cex=0.5,font=2)

text(Coord$Longitude[Coord$Réplicas=='2'],Coord$Latitude[Coord$Réplicas=='2'
],rownames(Coord)[Coord$Réplicas=='2'],col='yellow',cex=0.5,font=2)

text(Coord$Longitude[Coord$Réplicas=='3'],Coord$Latitude[Coord$Réplicas=='3'
],rownames(Coord)[Coord$Réplicas=='3'],col='blue',cex=0.5,font=2)

points(Coord$Longitude,Coord$Latitude-0.045,pch=20,cex=0.7)

text(c(41.5,41.3),c(21.7,20.6),c('RJ','ES'))

axis(1,xaxp=c(42.1,39.2,2),cex.axis=1)

axis(2,yaxp=c(23.9,20.3,4),cex.axis=1)

title(main='Bacia')

legend(40.2,23.5,c('Uma','Duas','Três'),pch=21,cex=1,pt.bg=c('red','yellow',
'blue'),bty='n',pt.cex=2,pt.lwd=0.6,title='Réplicas')

legend(39.8,23.5,c('Areia','Calcário','Lama'),pch=21,cex=1,pt.bg=c('lightyel
low','lightgray','lightgreen'),bty='n',pt.cex=2,pt.lwd=0.6,title='Faciologia
')

addlogo(N,px=c(40,39.8),py=c(21,20.8))

dev.off()

q('no')

 

-

MSc. Rodrigo Aluizio mailto:r.alui...@gmail.com 

Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RES: read a xls file

2009-01-18 Thread Rodrigo Aluizio
Hi Michele, there are at least two good alternatives.
xlsReadWrite (read only xls)
RODBC (the one I prefer, read xls and xlsx), odbcConnectExcel (read xls) and
odbcConnectExcel2007 (read xlsx).
The libraries help files bring to you better details.

Here are some examples of file importing (the setwd() is not an obligation):

Library(RODBC)
setwd('C:/Documents and Settings/Administrador/Meus
documentos/UFPR/Micropaleontologia/Potiguar/Monitoramento/Abril2008/')
Data-odbcConnectExcel('ANOVA-Monit2008.xls',readOnly=T,)
AbioRep-sqlFetch(Data,'AmbienteRep',colnames=F,rownames='Sample')
AbioMed-sqlFetch(Data,'AmbienteMed',colnames=F,rownames='Sample')
IndiecesFV-sqlFetch(Data,'Indices-FV',colnames=F,rownames='Sample')
IndiecesFT-sqlFetch(Data,'Indices-FT',colnames=F,rownames='Sample')
odbcClose(Dados)

library(xlsReadWrite)
setwd('C:/Documents and Settings/Administrador/Meus
documentos/Artigos/Disserta/')
Abio-read.xls('AF.xls',sheet=1,rowNames=T)
Bio-read.xls('AF.xls',sheet=2,rowNames=T)
SAbio-decostand(Abio,method='standardize')

Hope it helps
___
MSc. Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - BRASIL
Fone: (0**41) 3455-1496 ramal 217
Fax: (0**41) 3455-1105




-Mensagem original-
De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em
nome de Michele Santacatterina
Enviada em: domingo, 18 de janeiro de 2009 12:16
Para: R-help@r-project.org
Assunto: [R] read a xls file

Hello,

i have a xls file. I will read it in r, what library-command i use for
this??

any ideas??

Thanks

Michele

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Customized LDA (MASS) object plot

2009-01-04 Thread Rodrigo Aluizio
Hi R experts.

I performed an Linear Discriminant Analysis (lda) and now I want to plot the
first two axes (LDA1 and LDA2). Well MASS package have the plot.lda and
pairs.lda to do that. But, they don’t let me personalize them, once they
don’t accept the type=’n’ plot. So I start looking at the lda object
properties, trying to found out my groups (n=4) axis coordinates, curiously
I couldn’t. There is only the variables axis coordinates and some analysis
results. If I can reach this information, I’ll be able to create a
customized graph using the normal plot(), points() and par().

So the question is: How could I reach these axis coordinates inside my
object (supposing they are there somewhere, once the plot.lda and pairs.lda
are able to plot them)?

 

Thanks in advance.

___
MSc.  mailto:r.alui...@gmail.com Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - BRASIL
Fone: (0**41) 3455-1496 ramal 217
Fax: (0**41) 3455-1105




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RES: Customized LDA (MASS) object plot

2009-01-04 Thread Rodrigo Aluizio
Thanks for the enlightenment Prof. Ripley. I guess I've to start learning
quite more about panel function.
Once I'm pointed to the right way I'll probably be able to do what I want.
Sorry for the mistake, I totally misses the panel function possibilities.

Rodrigo.

-Mensagem original-
De: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] 
Enviada em: domingo, 4 de janeiro de 2009 11:15
Para: Rodrigo Aluizio
Cc: R Help
Assunto: Re: [R] Customized LDA (MASS) object plot

Hmm: what do you want to do that a customized panel function cannot do?

plot.lda does not accept type=n precisely because it does support a 
panel function to plot within the axes it has set up.  Your claim that 
'they don?t let me personalize them' is simply untrue.

If you want to see the source code, just type 'MASS:::plot.lda'.

Futhermore, MASS is support software for a book, and the book does have 
examples of customized LDA plots!


On Sun, 4 Jan 2009, Rodrigo Aluizio wrote:

 Hi R experts.

 I performed an Linear Discriminant Analysis (lda) and now I want to plot
the
 first two axes (LDA1 and LDA2). Well MASS package have the plot.lda and
 pairs.lda to do that. But, they don?t let me personalize them, once they
 don?t accept the type=?n? plot. So I start looking at the lda object
 properties, trying to found out my groups (n=4) axis coordinates,
curiously
 I couldn?t. There is only the variables axis coordinates and some analysis
 results. If I can reach this information, I?ll be able to create a
 customized graph using the normal plot(), points() and par().

 So the question is: How could I reach these axis coordinates inside my
 object (supposing they are there somewhere, once the plot.lda and
pairs.lda
 are able to plot them)?



 Thanks in advance.

 ___
 MSc.  mailto:r.alui...@gmail.com Rodrigo Aluizio
 Centro de Estudos do Mar/UFPR
 Laborat?rio de Micropaleontologia
 Avenida Beira Mar s/n - CEP 83255-000
 Pontal do Paran? - PR - BRASIL
 Fone: (0**41) 3455-1496 ramal 217
 Fax: (0**41) 3455-1105




   [[alternative HTML version deleted]]



-- 
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RES: How do I plot multiple XY plots on the same graph

2009-01-01 Thread Rodrigo Aluizio
Also, you can take a look at ?matplot function, depending on the type of
data and graphic output you want, it may b useful.

Best Wishes
___
MSc. Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - BRASIL
Fone: (0**41) 3455-1496 ramal 217
Fax: (0**41) 3455-1105



-Mensagem original-
De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em
nome de Carlos J. Gil Bellosta
Enviada em: quinta-feira, 1 de janeiro de 2009 10:27
Para: George Chen
Cc: r-help@r-project.org
Assunto: Re: [R] How do I plot multiple XY plots on the same graph

Hello,

You can use plot for the first plot and points for the subsequent ones.

Points will add new points to the existing plot reusing the axes,
labels, etc.

Best regards,

Carlos J. Gil Bellosta
http://www.datanalytics.com


On Wed, 2008-12-31 at 15:36 -0800, George Chen wrote:
 Hello,
 I have multiple data sets I would like to plot on the same XY scatterplot.
 The data sets have in common the same Y values.
 Could somebody tell me how to do this?
 I tried par(T=new)   (I think this was it) but it literally overlays plots
on each other.
 
 Thanks in advance.
 
 George
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Plotting a kriging on a map

2008-12-04 Thread Rodrigo Aluizio
Hi list,

Well, this time I’ve a doubt with mapping generation.

I was already able to read and plot shapefiles, plot point on this map. All
this without any problems, but now I want to do something that I think, only
Golden Software Surfer is capable of.

I would like to plot a kriging result on the existing map (map script
below). Well I looked for on the net, but I was not able to be sure of which
packages I’ll need to perform the kriging (maybe geoR?) and then plot it in
the area map.

Is R able to do that? What packages I need to know to do so?

I just need a starting point to go forward.

 

I need to generate something like this:

http://i288.photobucket.com/albums/ll162/Godrigos/Kriging.jpg

(but without the top right area, just the different grayscale kriging area).


 

library(xlsReadWrite)

library(maps)

library(mapdata)

library(maptools)

Pontos-read.xls('Pontos.xls',sheet=1,rowNames=T)

Prof-read.xls('Pontos.xls',sheet=2,rowNames=T)

Batimetria-readShapeSpatial(‘Batimetria.shp')

Municipios-readShapeSpatial('Municipios.shp')

Recifes-readShapeSpatial('Recifes.shp')

par(mar=c(4,0,0,0))

map('worldHires','brazil',ylim=c(,),xlim=c(,),type='n')

plot(Batimetria,ylab='',xlab='',border='lightgray',add=T)

plot(Recifes,ylab='',xlab='',lty='dashed',add=T)

plot(Municipios,ylab='',xlab='',col=rgb(229,229,229,max=255),add=T)

axis(1,xaxp=c(,,))

axis(2,yaxp=c(,,))

points(Pontos$long,Pontos$lat,pch=20)

text(Pontos$long,Pontos$lat,rownames(Pontos),pos=1,cex=0.5)

text(Prof$Long,Prof$Lat,rownames(Prof),col='darkgray',cex=0.8,srt=-24)

 

Ps.: Sorry for hiding the maps coordinates. I had to, a demand of my
coworkers.

 

Thanks in advance.

___
MSc.  mailto:[EMAIL PROTECTED] Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] 1-Pearson's R Distance

2008-11-28 Thread Rodrigo Aluizio
Claudia, Thomas and William thank you all so much.
It's exactly what we needed.
Works perfectly.

Rodrigo.

-Mensagem original-
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Em nome de Claudia Beleites
Enviada em: quinta-feira, 27 de novembro de 2008 14:01
Para: r-help@r-project.org
Assunto: Re: [R] 1-Pearson's R Distance

Hi Rodrigo, 

afaik, (1 - r_Pearson)/2 is used rather than 1 - r_Pearson. This gives a 
distance measure ranging between 0 and 1 rather than 0 and 2. But after all, 
dies does not change anything substantial.
see e.g. Theodoridis  Koutroumbas: Pattern Recognition. 

I didn't know of the proxy package, but the calculation it straightforward 
(though a bit wasteful I suspect: first the whole matrix is produced, and 
as.dist cuts it down again to a triangular matrix):

as.dist (0.5 - cor (t(x) / 2)) 

Take care wheter you want to use x or t(x).

HTH Claudia



-- 
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 (0 40) 5 58-34 47
email: [EMAIL PROTECTED]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] 1-Pearson's R Distance

2008-11-27 Thread Rodrigo Aluizio
Hi again List,

Well this time I’m writing for a friend (really J). He needs to create a
distance matrix based on an abundance matrix using the 1-Pearson’s R index.
Well I told him to look at the proxy package, but there is only Pearson
Index. He needs it to perform a clustering. Well, as soon as he told me
there proxy only had the Pearson index I thought: “He could just do
something like

NewObject-1-PearsonMatrixObject”

But I didn’t tell him that because I’m not sure it’s the same thing, and it
probably will generate a strange cluster with the braches ends distant from
the base…

He told me that Statistica 7.0 has this Index, but he doesn’t own it. So… Is
there a way on R to do this correctly?

 

Thanks for the attention.

___
MSc.  mailto:[EMAIL PROTECTED] Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - BRASIL
Fone: (0**41) 3455-1496 ramal 217
Fax: (0**41) 3455-1105




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RES: S4 object

2008-11-26 Thread Rodrigo Aluizio
Take a look at the links you will found on this previous post of the list.

http://tolstoy.newcastle.edu.au/R/help/06/01/18259.html

I myself don't know anything about this subject.

Sorry, but you probably will found what you need there.

Best Wishes

Rodrigo.

-Mensagem original-
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Em
nome de Laurina Guerra
Enviada em: quarta-feira, 26 de novembro de 2008 11:43
Para: r-help@r-project.org
Assunto: [R] S4 object

Hola buen dia!! Alguien me podrma orientar acerca de que es la clase S4
object y como funciona de la forma mas sencilla posible. Se les agradecerma
su respuesta lo mas pronto posible.. gracias!!


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Dendrogram labels

2008-11-21 Thread Rodrigo Aluizio
Take a look at the las() function o ?par. It permits you to choice  
labels directions.


__
Rodrigo Aluizio

Em 21/11/2008, às 17:14, Richardson, Patrick [EMAIL PROTECTED] 
g escreveu:

!#x000a
Is there any way to change the orientation of the labels on the end  
of the dendrograms to horizontal rather than vertical?  If so, how  
can I do that.  Below is my code, but I'm not sure which argument(s)  
I can use to change the label(s) (if it is possible to do).


a - hclust(z, method = complete)

# Plots hclust dendrogram #
plot(a, frame.plot=TRUE, lwd=2)

Many thanks,

_
Patrick Richardson
Biostatistician - Program of Translational Medicine
Van Andel Research Institute - Webb Lab
333 Bostwick Avenue NE
Grand Rapids, MI  49503
ph. 616.234.5787


This email message, including any attachments, is for th...{{dropped: 
9}}


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RES: Symbols output

2008-11-18 Thread Rodrigo Aluizio
A fast and simple way to do that would be something like this (the example
is a gray circle)

postscript('Circle.eps')
par(mar=c(0,0,0,0))
plot.new()
points(0.5,0.5,pch=21,cex=50,bg='gray')
dev.off()

You just have to chance the symbol (pch) and color (bg), the output will be
an EPS file, open it on an Image Editor (PhotoShop, Corel, etc) and save at
other format you want (png, jpg, tif, bmp, etc) with any resolution, the
background of the symbol will be transparent, so I recommend saving it as
tif or png!

Hope it helps...

-Mensagem original-
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Em
nome de Gareth Campbell
Enviada em: terça-feira, 18 de novembro de 2008 18:53
Para: R Help
Assunto: [R] Symbols output

Hi everyone,

I have a PCA plot that I'm writing about in the text.  There were so many
symbols in different colours on it that I didn't include a legend in the
plot as it would be useless.  So what I was hoping to do was to talk about
each set of replicates in the text and when I do that, use their coloured
symbol in the text.  So what I want to do is to get R to create some high
quality picture files of the symbols with the colours I tell it to.

Does anyone have an idea about the best way to go about this?  I created a
graph of the symbols and tried to use photoshop to cut them out, but it's
laborious and the quality is not the best.  I just want small sharp symbols.

Thanks

Gareth Campbell
PhD Candidate
The University of Auckland

P+649 815 3670
M+6421 256 3511
E   [EMAIL PROTECTED]
[EMAIL PROTECTED]

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RES: Symbols output

2008-11-18 Thread Rodrigo Aluizio
Sorry, the code is incomplete.
You get a better result this way...

postscript('Circle.eps',paper='special',width=4,height=4)
par(mar=c(0,0,0,0))
plot.new()
points(0.5,0.5,pch=21,cex=50,bg='gray')
dev.off()

-Mensagem original-
De: Rodrigo Aluizio [mailto:[EMAIL PROTECTED] 
Enviada em: terça-feira, 18 de novembro de 2008 19:28
Para: 'Gareth Campbell'
Cc: R Help (r-help@r-project.org)
Assunto: RES: [R] Symbols output

A fast and simple way to do that would be something like this (the example
is a gray circle)

postscript('Circle.eps')
par(mar=c(0,0,0,0))
plot.new()
points(0.5,0.5,pch=21,cex=50,bg='gray')
dev.off()

You just have to chance the symbol (pch) and color (bg), the output will be
an EPS file, open it on an Image Editor (PhotoShop, Corel, etc) and save at
other format you want (png, jpg, tif, bmp, etc) with any resolution, the
background of the symbol will be transparent, so I recommend saving it as
tif or png!

Hope it helps...

-Mensagem original-
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Em
nome de Gareth Campbell
Enviada em: terça-feira, 18 de novembro de 2008 18:53
Para: R Help
Assunto: [R] Symbols output

Hi everyone,

I have a PCA plot that I'm writing about in the text.  There were so many
symbols in different colours on it that I didn't include a legend in the
plot as it would be useless.  So what I was hoping to do was to talk about
each set of replicates in the text and when I do that, use their coloured
symbol in the text.  So what I want to do is to get R to create some high
quality picture files of the symbols with the colours I tell it to.

Does anyone have an idea about the best way to go about this?  I created a
graph of the symbols and tried to use photoshop to cut them out, but it's
laborious and the quality is not the best.  I just want small sharp symbols.

Thanks

Gareth Campbell
PhD Candidate
The University of Auckland

P+649 815 3670
M+6421 256 3511
E   [EMAIL PROTECTED]
[EMAIL PROTECTED]

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] PostScript File Dimensions

2008-11-15 Thread Rodrigo Aluizio
Hi List, here I go again.

Well I need to save plotted objects as .eps using the postscript() function,
well I can do that but all resulting object are perfect squared dimensions
(x = y). I need a rectangular output something like x = 2y dimension. Is it
possible? The I’m new to R and postscript image format!

 

I’m doing this…

 

postscript('ClusterWardBC.eps',setEPS(),bg='white')

plot(WardBC,which.plots=2,main='Living Fauna')

dev.off()

 

and I got the square image

 

I tried this to solve

 

postscript('ClusterWardBC.eps',setEPS(width=600,height=300),bg='white')

plot(WardBC,which.plots=2,main='Living Fauna')

dev.off()

 

and I got and output but any software or printer can handle it. So it’s
useless.

 

Any ideas?!

 

Ps.: The plotted object is a cluster tree, but it also occurs with other
plots I’ve done.

 

Thank you for the attention.

___
MSc.  mailto:[EMAIL PROTECTED] Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - BRASIL


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RES: PostScript File Dimensions

2008-11-15 Thread Rodrigo Aluizio
Thanks David, you are absolutely right, the solution was more simple than I
was wondering, sorry for the mistake.
I always read the help files and search the older topic of the list before
posting, but this time I wasn't able found out a solution for such a simple
thing. I got very closer to your suggestion with other tries I've not
included in my first mail. But I got an error saying The image is to large
and gave up. It was only a question of changing the width and height
values...

Once again thank you, I'll try harder a next time.

Rodrigo.

-Mensagem original-
De: David Winsemius [mailto:[EMAIL PROTECTED] 
Enviada em: sábado, 15 de novembro de 2008 15:57
Para: Rodrigo Aluizio
Cc: R Help
Assunto: Re: [R] PostScript File Dimensions

You may be new to R but that does not mean you should stay new to  
the help pages. It looks as though postscript() is ignoring your  
setEPS efforts,,, with perfectly legitimate reason since that is not a  
defined parameter for that function. It is a separate function. What  
happens when you use the height= and width= parameters that the  
postscript help page defines for you? That worked for me (on a Mac  
OS X 10.5.5/ R2.8.0-64bit GUI device). Or you could try executing  
setEPS before your postscript call.

Further questions, as is always the case with output sorts of  
questions, should include your systemInfo. This is an example in the  
help page with an added plot. to make the otherwise blank 4 x 3 eps  
file look more interesting:

  postscript(cm_test.eps, width = 4.0, height = 3.0,
+horizontal = FALSE, onefile = FALSE, paper = special,
+family = ComputerModern, encoding = TeXtext.enc)
  plot(1:10,10:1)
  dev.off()

-- 
David Winsemius
Heritage Labs




On Nov 15, 2008, at 9:00 AM, Rodrigo Aluizio wrote:

 Hi List, here I go again.

 Well I need to save plotted objects as .eps using the postscript()  
 function,
 well I can do that but all resulting object are perfect squared  
 dimensions
 (x = y). I need a rectangular output something like x = 2y  
 dimension. Is it
 possible? The I’m new to R and postscript image format!



 I’m doing this…



 postscript('ClusterWardBC.eps',setEPS(),bg='white')

 plot(WardBC,which.plots=2,main='Living Fauna')

 dev.off()



 and I got the square image



 I tried this to solve



 postscript 
 ('ClusterWardBC.eps',setEPS(width=600,height=300),bg='white')

 plot(WardBC,which.plots=2,main='Living Fauna')

 dev.off()



 and I got and output but any software or printer can handle it. So  
 it’s
 useless.



 Any ideas?!



 Ps.: The plotted object is a cluster tree, but it also occurs with  
 other
 plots I’ve done.



 Thank you for the attention.

 ___
 MSc.  mailto:[EMAIL PROTECTED] Rodrigo Aluizio
 Centro de Estudos do Mar/UFPR
 Laboratório de Micropaleontologia
 Avenida Beira Mar s/n - CEP 83255-000
 Pontal do Paraná - PR - BRASIL


   [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Multiple XY Lines Plot

2008-11-11 Thread Rodrigo Aluizio
Hi list, I’m trying to plot lines in the same graphic. There are lots of
similar topic on the list history. I’ve read about xyplot (lattice) and
other ways to do that but I only got complex error messages, and wasn’t able
even to start a decent R scrip. Well I have some paired information (each H
W ), were H is the y axis and W is the x axis, how could I plot all the four
lines at the same image? This lines must follow the points, they are
simplified beaches profiles. And the x and y axis limits must be something
like xlim=c(0,40.5) e ylim=c(0,-2.26).

 

I thought I could do that using plot (x,y,type=’n’) followed be lines(), but
I can’t do that because when I try to plot the lines I get a message saying
the axis size or limits are wrong or different. I used in plot()  x = 3-W
and y = 2-H, once they are greater values….

There’s also another problem, the only line I was able to plot (with
lines()) is a straight and I need lines passing by the x-y points.

 

 


1-H

1-W

2-H

2-W

3-H

3-W

4-H

4-W


0

0

0

0

0

0

0

0


-0,197

5,15

-0,345

3,83

-0,152

3,61

-0,085

3,2


-0,394

8,27

-0,48

8

-0,304

5,31

-0,23

4,1


-0,591

11,77

-0,685

12,41

-0,456

6,35

-0,285

4,65


-0,788

16,12

-0,905

16,82

-0,608

7,85

-0,38

6,35


-0,985

19,59

-1,205

21,23

-0,76

9,74

-0,68

8,45


-1,182

21,89

-1,38

25,64

-0,912

14,34

-0,755

10,5


-1,379

24,42

-1,675

30,05

-1,064

16,57

-0,81

12,8


-1,576

26,86

-2,255

34,5

-1,216

17,67

-0,87

14,75


-1,773

29,46

-1,375

19,77

-1,01

17,25


-1,905

32,16

-1,63

26,49

-1,405

26,35


-2,13

40,49



 

 

Thanks for the attention and patience.

___
MSc.  mailto:[EMAIL PROTECTED] Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - BRASIL




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RES: Multiple XY Lines Plot

2008-11-11 Thread Rodrigo Aluizio
Philipp you actually solved my problem when you mentioned matplot function.
I hadn't read anything about it before, when you mentioned I searched and
I'm getting what I need, now it's just a question of minor adjustments.

Below is a simple solution that I will now improve.

matplot(Perfil$3.W,Perfil$2.H,type='n',xlab='Length',ylab='Height')
lines(Perfil$1.W,Perfil$1.H,lty='solid')
lines(Perfil$2.W,Perfil$2.H,lty='dotted')
lines(Perfil$3.W,Perfil$3.H,lty='dashed')
lines(Perfil$4.W,Perfil$4.H,lty='dotdash')

Thank you!

-Mensagem original-
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Em
nome de Philipp Pagel
Enviada em: terça-feira, 11 de novembro de 2008 16:16
Para: r-help@r-project.org
Assunto: Re: [R] Multiple XY Lines Plot

 Hi list, I?m trying to plot lines in the same graphic. There are lots of
 similar topic on the list history. I?ve read about xyplot (lattice) and
 other ways to do that but I only got complex error messages, and wasn?t
able
 even to start a decent R scrip.

There are several ways to plot multiple lines and/or points in
one plot. xyplot, lines, points, matplot etc. come to mind.
Depending on the organization of your data, some of these will be
easier than others. As you didn't say anything about your data
structure, the commands you tried and the errors you encountered,
it is hard to be more specific at this point. Please give us a
short example to work with and I'm sure you'll get the answer you
need.

cu
Philipp

-- 
Dr. Philipp Pagel
Lehrstuhl für Genomorientierte Bioinformatik
Technische Universität München
Wissenschaftszentrum Weihenstephan
85350 Freising, Germany
http://mips.gsf.de/staff/pagel

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RES: R Mixed Anova

2008-11-06 Thread Rodrigo Aluizio
Thanks Mark, it was exactly what I was looking for.

-Mensagem original-
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Em nome de Mark Difford
Enviada em: quinta-feira, 6 de novembro de 2008 09:22
Para: r-help@r-project.org
Assunto: Re: [R] R Mixed Anova


Hi Rodrigo,

Here are two options; for each type, the second version gives 2nd order
interactions

## aov
T.aovmod - aov(response ~ Season + Beach + Line + Error(Block/Strata))
T.aovmod - aov(response ~ (Season + Beach + Line)^2 + Error(Block/Strata))

## lme
library(nlme)
T.lmemod - lme(response ~ Season + Beach + Line, random = ~ 1 |
Block/Strata)
T.lmemod - lme(response ~ (Season + Beach + Line)^2, random = ~ 1 |
Block/Strata)
anova(T.lmemod)
?anova.lme

## Use package multcomp for doing post-hoc analysis.

Regards, Mark.


Rodrigo Aluizio wrote:
 
 Hi list, I was searching how to properly write a command line for a mixed
 ANOVA. Well honestly, there are so many material on the older post of the
 list that just confused me.
 
 I have five factors.
 
  
 
 Season (fixed)
 
 Beach (fixed)
 
 Line (fixed)
 
 Block (random)
 
 Strata (random) nested in Block
 
  
 
 And for each of the tree strata per block I got 3 replicates. 
 
  
 
 I saw lots of things about “different” linear models commands… lm, lme… On
 R
 help I found aov and anova…
 
  
 
 Any one knows what should be more adequate and how I write and appropriate
 command line? I need an ANOVA table, a p value, and be able to run post
 hoc
 tests.
 
  
 
 Thanks for your attention and patience.
 
  
 
 ___
 MSc.  mailto:[EMAIL PROTECTED] Rodrigo Aluizio
 Centro de Estudos do Mar/UFPR
 Laboratório de Micropaleontologia
 Avenida Beira Mar s/n - CEP 83255-000
 Pontal do Paraná - PR - BRASIL
 Fone: (0**41) 3455-1496 ramal 217
 Fax: (0**41) 3455-1105
 
 
 
 
   [[alternative HTML version deleted]]
 
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 
 

-- 
View this message in context: 
http://www.nabble.com/R-Mixed-Anova-tp20358811p20359309.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R Mixed Anova

2008-11-06 Thread Rodrigo Aluizio
Hi list, I was searching how to properly write a command line for a mixed
ANOVA. Well honestly, there are so many material on the older post of the
list that just confused me.

I have five factors.

 

Season (fixed)

Beach (fixed)

Line (fixed)

Block (random)

Strata (random) nested in Block

 

And for each of the tree strata per block I got 3 replicates. 

 

I saw lots of things about “different” linear models commands… lm, lme… On R
help I found aov and anova…

 

Any one knows what should be more adequate and how I write and appropriate
command line? I need an ANOVA table, a p value, and be able to run post hoc
tests.

 

Thanks for your attention and patience.

 

___
MSc.  mailto:[EMAIL PROTECTED] Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - BRASIL
Fone: (0**41) 3455-1496 ramal 217
Fax: (0**41) 3455-1105




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Barplot Labels Problem

2008-11-05 Thread Rodrigo Aluizio
Hi List, well I’ve already asked this before, but I can’t figure out a
solution for the problem after trying many different ways.

So I writing again…

I’m using barplot function. I pretend to create a horizontal barplot with
two different information (side by side) for a species list. Well I can
generate the graph easily, but the problem is that the labels with the
species names are cut by device window!! I’ve tried lots of par functions
none seems to work properly.

Below are the script.

 

Height is a matrix of species and two column of numerical data. I used
par(las=) function to make the labels horizontal. When I do this they are
cut by the device window. If I don’t do that the label stay vertical and
make nonsense with the graph.

 

library(xlsReadWrite)

Spp-read.xls('SppPrincipaisFVeFT.xls',sheet=1,rowNames=T)

Spp-as.matrix(Spp)

barplot(t(Spp),axis.lty='solid',horiz=T,beside=T,las=1,col=c('lightgray','bl
ack'),main='Main Speceis')

legend('topright',c('Living Fauna','Dead
Fauna'),fill=c('lightgray','black'),bty='n')

 

Thanks for your attention

 

___
MSc.  mailto:[EMAIL PROTECTED] Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - BRASIL


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] RES: Barplot Labels Problem

2008-11-05 Thread Rodrigo Aluizio
Sorry for don't make the data available. My bad.
But anyway the Richard's fourth solution works quite well.

Thank you very much!

Rodrigo.

-Mensagem original-
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Enviada em: quarta-feira, 5 de novembro de 2008 10:59
Para: Rodrigo Aluizio
Cc: r-help@r-project.org; [EMAIL PROTECTED]
Assunto: Re: [R] Barplot Labels Problem

 I’m using barplot function. I pretend to create a horizontal barplot 
with
 two different information (side by side) for a species list. Well I can
 generate the graph easily, but the problem is that the labels with the
 species names are cut by device window!! I’ve tried lots of par 
functions
 none seems to work properly.
 
 Below are the script.
 
 
 
 Height is a matrix of species and two column of numerical data. I used
 par(las=) function to make the labels horizontal. When I do this they 
are
 cut by the device window. If I don’t do that the label stay vertical and
 make nonsense with the graph.
 
 
 
 library(xlsReadWrite)
 
 Spp-read.xls('SppPrincipaisFVeFT.xls',sheet=1,rowNames=T)
 
 Spp-as.matrix(Spp)
 
 
barplot(t(Spp),axis.lty='solid',horiz=T,beside=T,las=1,col=c('lightgray','bl
 ack'),main='Main Speceis')
 
 legend('topright',c('Living Fauna','Dead
 Fauna'),fill=c('lightgray','black'),bty='n')

I can't recreate your code, since you haven't made the file 
SppPrincipaisFVeFT.xls available.  I guess it's something like this:

x = c(monkey=25, giraffe=13, rhinocerous=46, squirrel=5, sting ray=36, 
cheetah=2, penguin=69, chicken=43)
par(las=1)
barplot(x)

On my machine, not all the animal names are shown when the device window 
opens.  You have several options to solve this.

1. Make the device bigger.  Either drag the corner of the window or, if 
you are writing directly to a file, try something like:
png(animal barplot.png, width=1200, height=800)
par(las=1)
barplot(x)
dev.off()

2. Make the axis text smaller, e.g.
barplot(x, cex.names=0.5)

3. Abbreviate the names, e.g.
barplot(x, names.arg=abbreviate(names(x)))

4. You can also get a little extra room by decreasing the plot margins and 
the amount of space between bars, e.g.
par(las=1, mar=c(2.5,3,0.5, 0.3))
barplot(x, space=0.05)

Regards,
Richie.

Mathematical Sciences Unit
HSL



ATTENTION:

This message contains privileged and confidential inform...{{dropped:20}}

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Barplot Labels Problem

2008-10-26 Thread Rodrigo Aluizio

Thanks for the help Jim,
The legend function solved the legend border problem but the labels, even 
using staxlab from plotrix are still being cut by the device limits, like 
there is some kind of character number limits or something like that.

Anyway thank you so much, I'll keep trying and searching.

Rodrigo.

--
From: Jim Lemon [EMAIL PROTECTED]
Sent: Saturday, October 25, 2008 9:16 AM
To: Rodrigo Aluizio [EMAIL PROTECTED]
Cc: R Help r-help@r-project.org
Subject: Re: [R] Barplot Labels Problem


Rodrigo Aluizio wrote:

Hi everybody,
well I'm trying to use barplot for the first time. I get a suitable 
graphic but I'm having a weird problem.
My graphic is generated from a matrix with several species (rowNames) and 
two abundance columns.
So each species will have two bars, and the species name should appear at 
left. Until now everything is Ok, but when a I plot it the species names 
(my labels) are cut by device limits, and only part of the names appear.
I could move them with the command line=some negative value, but the 
axis (x and y) stay put and the things get over each other (the command 
'line' works, but a error saying that it's not a graphic parameter 
appears). In addition, but with less importance, how could I remove the 
legend borders? And why, when I try use the 'width' command it fails to 
raise the width of the bars and I get and error saying that its not a 
graphic parameter (the command is in barplot help!!)?


I'm using R 2.8.0 at Windows XP 32 bits.

Here is the code I'm using, where MainSpp is my matrix:

barplot(MainSpp,horiz=T,beside=T,main='Main Species',xlab='%',las=1,
legend.text=T,width=5,cex.names=0.8)



Hi Rodrigo,
I think that the  function in the plotrix package might do what you want.

For the legend problem, I would suggest not using the barplot legend 
option but using the legend function with bty=n.


Jim



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Barplot Labels Problem

2008-10-24 Thread Rodrigo Aluizio
Hi everybody,
well I'm trying to use barplot for the first time. I get a suitable graphic but 
I'm having a weird problem.
My graphic is generated from a matrix with several species (rowNames) and two 
abundance columns.
So each species will have two bars, and the species name should appear at left. 
Until now everything is Ok, but when a I plot it the species names (my labels) 
are cut by device limits, and only part of the names appear.
I could move them with the command line=some negative value, but the axis (x 
and y) stay put and the things get over each other (the command 'line' works, 
but a error saying that it's not a graphic parameter appears). In addition, but 
with less importance, how could I remove the legend borders? And why, when I 
try use the 'width' command it fails to raise the width of the bars and I get 
and error saying that its not a graphic parameter (the command is in barplot 
help!!)?

I'm using R 2.8.0 at Windows XP 32 bits.

Here is the code I'm using, where MainSpp is my matrix:

barplot(MainSpp,horiz=T,beside=T,main='Main Species',xlab='%',las=1,
legend.text=T,width=5,cex.names=0.8)

Thank you for your attenction.
___
MSc. Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - BRASIL

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Avoiding Biplot Labels Overllaping

2008-10-23 Thread Rodrigo Aluizio
Hi everybody,
I'm trying, without success, to avoid some variables labels to overlap on a 
capscale (vegan package) object graph.
I was able to move the labels with the coding below, but it moves the entire 
vector... 

CAPobj-CAPpotiFT
for(i in c(2:8))CAPobj$CCA[[i]][,1]-CAPpotiFTI$CCA[[i]][,1]
CAPpotiFTI$CCA[[i]][,1][2]-0.85

And here the graphic script

ScoresCAPFT-scores(CAPpotiFTI)
FatoresRep-read.xls('Fatores.xls',sheet=1,rowNames=T)
plot.cca(CAPpotiFTI,type='none',display=c('bp','sites'),main='Total Fauna - 
Sites vs. Environment')
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='1',],pch=21)
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='2',],pch=20)
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='3',],pch=21,bg='gray')
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='4',],pch=24)
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='5',],pch=24,bg='gray')
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='6',],pch=24,bg='black')
text.cca(CAPpotiFTI,dis='cn',col='black',cex=0.6,lwd=0.5,lty='dotted')

Well it's data manipulation, I won't use that... 
So... Any one knows how to move the labels, keeping the vectors position on a 
cca-like biplot?

Thanks for your attention!
___
MSc. Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - BRASIL
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Avoiding Biplot Labels Overllaping

2008-10-23 Thread Rodrigo Aluizio
Sorry, just correcting the script!!!

Hi everybody,
I'm trying, without success, to avoid some variables labels to overlap on a 
capscale (vegan package) object graph.
I was able to move the labels with the coding below, but it moves the entire 
vector... 

CAPobj-CAPpotiFT
for(i in c(2:8))CAPobj$CCA[[i]][,1]-CAPobj$CCA[[i]][,1]
CAPobj$CCA[[i]][,1][2]-0.85

And here the graphic script

ScoresCAPFT-scores(CAPobj)
FatoresRep-read.xls('Fatores.xls',sheet=1,rowNames=T)
plot.cca(CAPobj,type='none',display=c('bp','sites'),main='Total Fauna - Sites 
vs. Environment')
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='1',],pch=21)
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='2',],pch=20)
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='3',],pch=21,bg='gray')
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='4',],pch=24)
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='5',],pch=24,bg='gray')
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='6',],pch=24,bg='black')
text.cca(CAPpotiFTI,dis='cn',col='black',cex=0.6,lwd=0.5,lty='dotted')

Well it's data manipulation, I won't use that... 
So... Any one knows how to move the labels, keeping the vectors position on a 
cca-like biplot?

Thanks for your attention!
___
MSc. Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - BRASIL
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Mirror Image on Biplot Graphic

2008-10-07 Thread Rodrigo Aluizio
He everybody,
Well I have a biplot CCA-like origined from plot.cca (vegan package). I need to 
rotate on y axis the lines and symbols of constrained and sites representation. 
If I do that on an image editor, I rotate everything, including titles, axes 
labels and positions. I just need to rotate the inner par and keep the 
variables names (constrained) and symbols in the new positions but with the 
right direction.
So, is there on R a way to do that while creating the image?
Here is the code that generate the graphic.

plot.cca(CAPpotiFT,type='none',display=c('bp','sites'),main='Total Fauna
Sites x Environment')
text.cca(CAPpotiFT,dis='cn',col='black',cex=0.6,lwd=0.5,lty='dotted')
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='1',],pch=21)
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='2',],pch=20)
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='3',],pch=22,bg='gray')
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='4',],pch=24)
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='5',],pch=24,bg='black')
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='6',],pch=25,bg='gray')

Thanks in advice.
___
MSc. Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Mirror Image on Biplot Graphic

2008-10-07 Thread Rodrigo Aluizio

Thanks a lot for your help (again) Mark.
I adapted your suggestion to my analysis.
But I'm getting and error when trying to apply the new values.
The error is:

Erro em scores(CAPpotiFTI)$species[, 2] - scores(CAPpotiFTI)$species[,  :
 não foi posssível encontrar a função scores-

Translating:
Error at scores(CAPpotiFTI)$species[, 2] - scores(CAPpotiFTI)$species[, 
:

 it's not possible to find the function scores-

Bellow how I applied the suggestion:
CAPpotiFTI-CAPpotiFT
scores(CAPpotiFTI)$species[,2]-scores(CAPpotiFTI)$species[,2]*-1
scores(CAPpotiFTI)$sites[,2]-scores(CAPpotiFTI)$sites[,2]*-1

Any ideas? I'm trying similar things but without success.

--
From: Mark Difford [EMAIL PROTECTED]
Sent: Tuesday, October 07, 2008 10:34 AM
To: r-help@r-project.org
Subject: Re: [R] Mirror Image on Biplot Graphic



Hi Rodrigo,

Sorry, that will not return a result (I use several different ordination
packages, in most of which this is possible). What you need to do with 
vegan

is the following:

scores(mynew.cca)$species[, 2] - scores(mynew.cca)$species[, 2] * -1

You will be able to do the rest.

Regards, Mark.


Mark Difford wrote:


Hi Rodrigo,


I need to rotate on y axis the lines and symbols of constrained and
sites representation.


Easiest is to multiply the axis you want to invert by -1. Something like
the following, where my.cca is the orginal object and yax = obj[, 2] 
(xax

being obj[, 1]). Obviously, copying isn't necessary.

mynew.cca - my.cca
mynew.cca$scores$species[, 2] - my.cca$scores$species[, 2] * -1
mynew.cca$scores$sites[, 2] - my.cca$scores$sites[, 2] * -1
mynew.cca$scores$centroids[, 2] - my.cca$scores$centroids[, 2] * -1

Regards, Mark.


Rodrigo Aluizio wrote:


He everybody,
Well I have a biplot CCA-like origined from plot.cca (vegan package). I
need to rotate on y axis the lines and symbols of constrained and sites
representation. If I do that on an image editor, I rotate everything,
including titles, axes labels and positions. I just need to rotate the
inner par and keep the variables names (constrained) and symbols in the
new positions but with the right direction.
So, is there on R a way to do that while creating the image?
Here is the code that generate the graphic.

plot.cca(CAPpotiFT,type='none',display=c('bp','sites'),main='Total 
Fauna

Sites x Environment')
text.cca(CAPpotiFT,dis='cn',col='black',cex=0.6,lwd=0.5,lty='dotted')
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='1',],pch=21)
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='2',],pch=20)
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='3',],pch=22,bg='gray')
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='4',],pch=24)
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='5',],pch=24,bg='black')
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='6',],pch=25,bg='gray')

Thanks in advice.
___
MSc. Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia

[[alternative HTML version deleted]]


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.







--
View this message in context: 
http://www.nabble.com/Mirror-Image-on-Biplot-Graphic-tp19857549p19858268.html

Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html

and provide commented, minimal, self-contained, reproducible code.



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Mirror Image on Biplot Graphic

2008-10-07 Thread Rodrigo Aluizio

Ok Mark, it worked for the species.
I still get an error if I try with biplot (cn,sp), but it's not a problem, 
repositioning the species is enough.

Thanks once again.

Just for future consults the error that still remains:
CAPpotiFTI-scores(CAPpotiFT, display=c('bp','species','cn','sites')
CAPpotiFTI$species[,1]-CAPpotiFTI$species[,1]*-1
CAPpotiFTI$cn[,1]-CAPpotiFTI$cn[,1]*-1
CAPpotiFTI$sites[,1]-CAPpotiFTI$sites[,1]*-1
CAPpotiFTI$bp[,1]-CAPpotiFTI$bp[,1]*-1
plot.cca(CAPpotiFTI,type='none',display=c('bp','species'),main='Total Fauna
+ Species x Environment')
Erro em match.arg(display) : 'arg' must be of length 1

or

text.cca(scores(CAPpotiFTI$biplot),col=323232,cex=0.6,lwd=2,lty='dotted')
Doesn't return an error, but it's not a mirror image as expected, it's 
nonsense.


--
From: Mark Difford [EMAIL PROTECTED]
Sent: Tuesday, October 07, 2008 12:22 PM
To: r-help@r-project.org
Subject: Re: [R] Mirror Image on Biplot Graphic



Hi Rodrigo,

Sorry again: the structure vegan uses is quite complex. Technically you
should use the extractor function scores() to extract what you want from 
the

object, e.g. scores(my.cca, display=species) or scores(my.cca,
display=cn) [centroids]. I did work out a quicker way of reversing axes,
but that seems to have gone walking...and I am not using vegan at the
moment.

Quickest hack is to make a copy of the objects you want to plot, reversing
orientations along the way. So do (my.cca is your original object):

Temp.data - scores(my.cca, display=c(sites, species, cn))

## Reverse yaxes
Temp.data$sites[, 2] - Temp.data$sites[, 2] * -1
Temp.data$species[, 2] - Temp.data$species[, 2] * -1
Temp.data$centroid[, 2] - Temp.data$centroid[, 2] * -1

Do this for all the things you are plotting whose axes you want reversed.
Check this against your original plot to ensure that the mirror isn't
broken.

You can then use the Temp.data with the scores() function to make your 
plot.


## Mock e.g.
points(scores(Temp.data, display=sites), pch=21)

Regards, Mark.


Rodrigo Aluizio wrote:



Thanks a lot for your help (again) Mark.
I adapted your suggestion to my analysis.
But I'm getting and error when trying to apply the new values.
The error is:

Erro em scores(CAPpotiFTI)$species[, 2] - scores(CAPpotiFTI)$species[,
:
 não foi posssível encontrar a função scores-

Translating:
Error at scores(CAPpotiFTI)$species[, 2] - scores(CAPpotiFTI)$species[,
:
 it's not possible to find the function scores-

Bellow how I applied the suggestion:
CAPpotiFTI-CAPpotiFT
scores(CAPpotiFTI)$species[,2]-scores(CAPpotiFTI)$species[,2]*-1
scores(CAPpotiFTI)$sites[,2]-scores(CAPpotiFTI)$sites[,2]*-1

Any ideas? I'm trying similar things but without success.

--



Sent: Tuesday, October 07, 2008 10:34 AM
To: r-help@r-project.org
Subject: Re: [R] Mirror Image on Biplot Graphic



Hi Rodrigo,

Sorry, that will not return a result (I use several different 
ordination

packages, in most of which this is possible). What you need to do with
vegan
is the following:

scores(mynew.cca)$species[, 2] - scores(mynew.cca)$species[, 2] * -1

You will be able to do the rest.

Regards, Mark.


Mark Difford wrote:


Hi Rodrigo,


I need to rotate on y axis the lines and symbols of constrained and
sites representation.


Easiest is to multiply the axis you want to invert by -1. Something
like
the following, where my.cca is the orginal object and yax = obj[, 2]
(xax
being obj[, 1]). Obviously, copying isn't necessary.

mynew.cca - my.cca
mynew.cca$scores$species[, 2] - my.cca$scores$species[, 2] * -1
mynew.cca$scores$sites[, 2] - my.cca$scores$sites[, 2] * -1
mynew.cca$scores$centroids[, 2] - my.cca$scores$centroids[, 2] * -1

Regards, Mark.


Rodrigo Aluizio wrote:


He everybody,
Well I have a biplot CCA-like origined from plot.cca (vegan package).
I
need to rotate on y axis the lines and symbols of constrained and
sites
representation. If I do that on an image editor, I rotate everything,
including titles, axes labels and positions. I just need to rotate 
the

inner par and keep the variables names (constrained) and symbols in
the
new positions but with the right direction.
So, is there on R a way to do that while creating the image?
Here is the code that generate the graphic.

plot.cca(CAPpotiFT,type='none',display=c('bp','sites'),main='Total
Fauna
Sites x Environment')
text.cca(CAPpotiFT,dis='cn',col='black',cex=0.6,lwd=0.5,lty='dotted')
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='1',],pch=21)
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='2',],pch=20)
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='3',],pch=22,bg='gray')
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='4',],pch=24)
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='5',],pch=24,bg='black')
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='6',],pch=25,bg='gray')

Thanks in advice.
___
MSc. Rodrigo Aluizio
Centro de Estudos

Re: [R] Mirror Image on Biplot Graphic

2008-10-07 Thread Rodrigo Aluizio

Sorry for the mistake, I'm trying to rotate the CAP 1 axis not 2!
Ah well, I tried the this other way, but it gave me an error.
Something in the syntax, I tried to change something but didn't fix the 
error.


CAPpotiFTI-CAPpotiFT
for(i in c(2:8,15)) CAPpotiFTI$CCA[[i]][,2]-CAPpotiFTI,cca$CCA[[i]][,1]*-1
Erro: unexpected ',' in for(i in c(2:8,15)) 
CAPpotiFTI$CCA[[i]][,2]-CAPpotiFTI,


for(i in c(2:8,15)) CAPpotiFTI$CCA[[i]][,1]-CAPpotiFTI$CCA[[i]][,1]*-1
Erro em CAPpotiFTI$CCA[[i]] : índice fora de limites (index out of limits)

Well, it needs lots of patience...

--
From: Mark Difford [EMAIL PROTECTED]
Sent: Tuesday, October 07, 2008 3:50 PM
To: r-help@r-project.org
Subject: Re: [R] Mirror Image on Biplot Graphic



Hi Rodrigo,

Again an error, as that doesn't touch one of the data structures. You need
to extend the range to include #15, as below:

## This does axis 2
mynew.cca - my.cca
for (i in c(2:8,15)) mynew.cca$CCA[[i]][, 2] - mynew,cca$CCA[[i]][, 2] 
* -1


Cheers, Mark.


Mark Difford wrote:


Hi Rodrigo,

I looked through my scripts and found my old hack. __WARNING__: Be very
careful to check that
the mirror isn't broken and that all is in order! Make sure that you are
reversing the axes you want. In your original post you mention axis 2,
i.e. y-axis. Below you have used axis 1.

## This does axis 2
mynew.cca - my.cca
for (i in 2:8) mynew.cca$CCA[[i]][, 2] - mynew,cca$CCA[[i]][, 2] * -1

plot(mynew.cca)

## This does axis 1
for (i in 2:8) mynew.cca$CCA[[i]][, 1] - mynew,cca$CCA[[i]][, 1] * -1

Regards, Mark.


Rodrigo Aluizio wrote:


Ok Mark, it worked for the species.
I still get an error if I try with biplot (cn,sp), but it's not a
problem,
repositioning the species is enough.
Thanks once again.

Just for future consults the error that still remains:
CAPpotiFTI-scores(CAPpotiFT, display=c('bp','species','cn','sites')
CAPpotiFTI$species[,1]-CAPpotiFTI$species[,1]*-1
CAPpotiFTI$cn[,1]-CAPpotiFTI$cn[,1]*-1
CAPpotiFTI$sites[,1]-CAPpotiFTI$sites[,1]*-1
CAPpotiFTI$bp[,1]-CAPpotiFTI$bp[,1]*-1
 plot.cca(CAPpotiFTI,type='none',display=c('bp','species'),main='Total
Fauna
+ Species x Environment')
Erro em match.arg(display) : 'arg' must be of length 1

or

text.cca(scores(CAPpotiFTI$biplot),col=323232,cex=0.6,lwd=2,lty='dotted')
Doesn't return an error, but it's not a mirror image as expected, it's
nonsense.

--



Sent: Tuesday, October 07, 2008 12:22 PM
To: r-help@r-project.org
Subject: Re: [R] Mirror Image on Biplot Graphic



Hi Rodrigo,

Sorry again: the structure vegan uses is quite complex. Technically you
should use the extractor function scores() to extract what you want 
from

the
object, e.g. scores(my.cca, display=species) or scores(my.cca,
display=cn) [centroids]. I did work out a quicker way of reversing
axes,
but that seems to have gone walking...and I am not using vegan at the
moment.

Quickest hack is to make a copy of the objects you want to plot,
reversing
orientations along the way. So do (my.cca is your original object):

Temp.data - scores(my.cca, display=c(sites, species, cn))

## Reverse yaxes
Temp.data$sites[, 2] - Temp.data$sites[, 2] * -1
Temp.data$species[, 2] - Temp.data$species[, 2] * -1
Temp.data$centroid[, 2] - Temp.data$centroid[, 2] * -1

Do this for all the things you are plotting whose axes you want
reversed.
Check this against your original plot to ensure that the mirror isn't
broken.

You can then use the Temp.data with the scores() function to make your
plot.

## Mock e.g.
points(scores(Temp.data, display=sites), pch=21)

Regards, Mark.


Rodrigo Aluizio wrote:



Thanks a lot for your help (again) Mark.
I adapted your suggestion to my analysis.
But I'm getting and error when trying to apply the new values.
The error is:

Erro em scores(CAPpotiFTI)$species[, 2] -
scores(CAPpotiFTI)$species[,
:
 não foi posssível encontrar a função scores-

Translating:
Error at scores(CAPpotiFTI)$species[, 2] -
scores(CAPpotiFTI)$species[,
:
 it's not possible to find the function scores-

Bellow how I applied the suggestion:
CAPpotiFTI-CAPpotiFT
scores(CAPpotiFTI)$species[,2]-scores(CAPpotiFTI)$species[,2]*-1
scores(CAPpotiFTI)$sites[,2]-scores(CAPpotiFTI)$sites[,2]*-1

Any ideas? I'm trying similar things but without success.

--



Sent: Tuesday, October 07, 2008 10:34 AM
To: r-help@r-project.org
Subject: Re: [R] Mirror Image on Biplot Graphic



Hi Rodrigo,

Sorry, that will not return a result (I use several different
ordination
packages, in most of which this is possible). What you need to do
with
vegan
is the following:

scores(mynew.cca)$species[, 2] - scores(mynew.cca)$species[, 2] 
* -1


You will be able to do the rest.

Regards, Mark.


Mark Difford wrote:


Hi Rodrigo,


I need to rotate on y axis the lines and symbols of constrained
and
sites representation.


Easiest is to multiply the axis you want to invert by -1

Re: [R] Mirror Image on Biplot Graphic

2008-10-07 Thread Rodrigo Aluizio

Well this time I have to assume, I'm not understanding what is wrong now.
And I have to say: 'Thank You for your patience', cause I'm going crazy 
here! :-)


Mark, I tried this:

CAPpotiFTI-CAPpotiFT
for(i in c(2:8,15)) CAPpotiFTI$CCA[[i]][, 1]-CAPpotiFTI$CCA[[i]][, 1] * -1

and got this:

Erro em CAPpotiFTI$CCA[[i]] : índice fora de limites (index out of limits)

Here is the script until this point

library(vegan)
library(xlsReadWrite)
#FT--#
PotiAbioFT-read.xls('FatorialReplica.xls',sheet=4,rowNames=T)
PotiBioFT-read.xls('FatorialReplica.xls',sheet=6,rowNames=T)
attach(PotiAbioFT)
LogPotiBioFT-log(PotiBioFT+1)
CAPpotiFT-capscale(t(LogPotiBioFT)~Envoronmental+Variables,dist=bray,add=T)
PermCAPFT-anova.cca(CAPpotiFT,alpha=0.05,model='full',first=F,permutations=999)
PermCAPFT
summary(CAPpotiFT)
# Rotating the axis
CAPpotiFTI-CAPpotiFT
for(i in c(2:8,15)) CAPpotiFTI$CCA[[i]][, 1]-CAPpotiFTI$CCA[[i]][, 1] * -1



--
From: Mark Difford [EMAIL PROTECTED]
Sent: Tuesday, October 07, 2008 5:17 PM
To: r-help@r-project.org
Subject: Re: [R] Mirror Image on Biplot Graphic



Hi Rodrigo,

Yes it does, but this will work. You have erroneously used a , in your
call, it should be a ., if anything. You have also inserted cca... And
the axes being switched must be conformant:


CAPpotiFTI-CAPpotiFT
for(i in c(2:8,15))
CAPpotiFTI$CCA[[i]][,2]-CAPpotiFTI,cca$CCA[[i]][,1]*-1  ## you are
writing axis 1 over axis 2; and there is no ...,cca...

Erro: unexpected ',' in for(i in c(2:8,15))   ## unexpected

comma

CAPpotiFTI$CCA[[i]][,2]-CAPpotiFTI,


## Using your example to switch axis 1. Make sure that CAPpotiFT exists 
and

is your
## original object. Copy and paste the lines below into your R console
window and run
CAPpotiFTI - CAPpotiFT
for(i in c(2:8,15)) CAPpotiFTI$CCA[[i]][, 1]-CAPpotiFTI$CCA[[i]][, 1] 
* -1


Cheers, Mark.


Rodrigo Aluizio wrote:



[[elided Yahoo spam]]

Ah well, I tried the this other way, but it gave me an error.
Something in the syntax, I tried to change something but didn't fix the
error.

CAPpotiFTI-CAPpotiFT
 for(i in c(2:8,15))
CAPpotiFTI$CCA[[i]][,2]-CAPpotiFTI,cca$CCA[[i]][,1]*-1
Erro: unexpected ',' in for(i in c(2:8,15))
CAPpotiFTI$CCA[[i]][,2]-CAPpotiFTI,

 for(i in c(2:8,15)) CAPpotiFTI$CCA[[i]][,1]-CAPpotiFTI$CCA[[i]][,1]*-1
Erro em CAPpotiFTI$CCA[[i]] : índice fora de limites (index out of 
limits)


Well, it needs lots of patience...

--



Sent: Tuesday, October 07, 2008 3:50 PM
To: r-help@r-project.org
Subject: Re: [R] Mirror Image on Biplot Graphic



Hi Rodrigo,

Again an error, as that doesn't touch one of the data structures. You
need
to extend the range to include #15, as below:

## This does axis 2
mynew.cca - my.cca
for (i in c(2:8,15)) mynew.cca$CCA[[i]][, 2] - mynew,cca$CCA[[i]][, 2]
* -1

Cheers, Mark.


Mark Difford wrote:


Hi Rodrigo,

I looked through my scripts and found my old hack. __WARNING__: Be very
careful to check that
the mirror isn't broken and that all is in order! Make sure that you 
are

reversing the axes you want. In your original post you mention axis 2,
i.e. y-axis. Below you have used axis 1.

## This does axis 2
mynew.cca - my.cca
for (i in 2:8) mynew.cca$CCA[[i]][, 2] - mynew,cca$CCA[[i]][, 2] * -1

plot(mynew.cca)

## This does axis 1
for (i in 2:8) mynew.cca$CCA[[i]][, 1] - mynew,cca$CCA[[i]][, 1] * -1

Regards, Mark.


Rodrigo Aluizio wrote:


Ok Mark, it worked for the species.
I still get an error if I try with biplot (cn,sp), but it's not a
problem,
repositioning the species is enough.
Thanks once again.

Just for future consults the error that still remains:
CAPpotiFTI-scores(CAPpotiFT, display=c('bp','species','cn','sites')
CAPpotiFTI$species[,1]-CAPpotiFTI$species[,1]*-1
CAPpotiFTI$cn[,1]-CAPpotiFTI$cn[,1]*-1
CAPpotiFTI$sites[,1]-CAPpotiFTI$sites[,1]*-1
CAPpotiFTI$bp[,1]-CAPpotiFTI$bp[,1]*-1
 plot.cca(CAPpotiFTI,type='none',display=c('bp','species'),main='Total
Fauna
+ Species x Environment')
Erro em match.arg(display) : 'arg' must be of length 1

or

text.cca(scores(CAPpotiFTI$biplot),col=323232,cex=0.6,lwd=2,lty='dotted')
Doesn't return an error, but it's not a mirror image as expected, it's
nonsense.

--



Sent: Tuesday, October 07, 2008 12:22 PM
To: r-help@r-project.org
Subject: Re: [R] Mirror Image on Biplot Graphic



Hi Rodrigo,

Sorry again: the structure vegan uses is quite complex. Technically
you
should use the extractor function scores() to extract what you want
from
the
object, e.g. scores(my.cca, display=species) or scores(my.cca,
display=cn) [centroids]. I did work out a quicker way of reversing
axes,
but that seems to have gone walking...and I am not using vegan at the
moment.

Quickest hack is to make a copy of the objects you want to plot,
reversing
orientations along the way. So do (my.cca is your original object):

Temp.data - scores

Re: [R] Mirror Image on Biplot Graphic

2008-10-07 Thread Rodrigo Aluizio

Exactly. It's solved. Just remove #15.

CAPpotiFTI-CAPpotiFT
for(i in c(2:8))CAPpotiFTI$CCA[[i]][,1]-CAPpotiFTI$CCA[[i]][,1]*-1

It seems that I've to pay more attention and study more about R language.

Thanks a lot once more.

Rodrigo.

--
From: Mark Difford [EMAIL PROTECTED]
Sent: Tuesday, October 07, 2008 6:34 PM
To: r-help@r-project.org
Subject: Re: [R] Mirror Image on Biplot Graphic



Hi Rodrigo,

This is because [I now see] you are working on a capscale object, not a 
cca
object, which is what I thought you were using. It still works, though, 
even
with c(2:8,15), though DF #15 doesn't exist in capscale objects. To show 
you
that this is so, run the example below, which uses a data set from vegan. 
I

have dropped #15 from the selection set.

## Ex. of switching axes of capscale object
windows(); par(mfrow=c(2,2))
data(varespec)
data(varechem)
vare.cap - capscale(varespec ~ N + P + K + Condition(Al), varechem,
dist=bray)
plot(vare.cap)
for(i in c(2:8)) vare.cap$CCA[[i]][, 1]-vare.cap$CCA[[i]][, 1] * -1
plot(vare.cap)
for(i in c(2:8)) vare.cap$CCA[[i]][, 2]-vare.cap$CCA[[i]][, 2] * -1
plot(vare.cap)
for(i in c(2:8)) vare.cap$CCA[[i]][, 1:2]-vare.cap$CCA[[i]][, 1:2] * -1
plot(vare.cap)

Cheers, Mark.


Rodrigo Aluizio wrote:


Well this time I have to assume, I'm not understanding what is wrong now.
And I have to say: 'Thank You for your patience', cause I'm going crazy
here! :-)

Mark, I tried this:

CAPpotiFTI-CAPpotiFT
for(i in c(2:8,15)) CAPpotiFTI$CCA[[i]][, 1]-CAPpotiFTI$CCA[[i]][, 1] *
-1

and got this:

Erro em CAPpotiFTI$CCA[[i]] : índice fora de limites (index out of 
limits)


Here is the script until this point

library(vegan)
library(xlsReadWrite)
#FT--#
PotiAbioFT-read.xls('FatorialReplica.xls',sheet=4,rowNames=T)
PotiBioFT-read.xls('FatorialReplica.xls',sheet=6,rowNames=T)
attach(PotiAbioFT)
LogPotiBioFT-log(PotiBioFT+1)
CAPpotiFT-capscale(t(LogPotiBioFT)~Envoronmental+Variables,dist=bray,add=T)
PermCAPFT-anova.cca(CAPpotiFT,alpha=0.05,model='full',first=F,permutations=999)
PermCAPFT
summary(CAPpotiFT)
# Rotating the axis
CAPpotiFTI-CAPpotiFT
for(i in c(2:8,15)) CAPpotiFTI$CCA[[i]][, 1]-CAPpotiFTI$CCA[[i]][, 1] *
-1



--



Sent: Tuesday, October 07, 2008 5:17 PM
To: r-help@r-project.org
Subject: Re: [R] Mirror Image on Biplot Graphic



Hi Rodrigo,

Yes it does, but this will work. You have erroneously used a , in your
call, it should be a ., if anything. You have also inserted cca...
And
the axes being switched must be conformant:


CAPpotiFTI-CAPpotiFT
for(i in c(2:8,15))
CAPpotiFTI$CCA[[i]][,2]-CAPpotiFTI,cca$CCA[[i]][,1]*-1  ## you are
writing axis 1 over axis 2; and there is no ...,cca...

Erro: unexpected ',' in for(i in c(2:8,15))   ## unexpected

comma

CAPpotiFTI$CCA[[i]][,2]-CAPpotiFTI,


## Using your example to switch axis 1. Make sure that CAPpotiFT exists
and
is your
## original object. Copy and paste the lines below into your R console
window and run
CAPpotiFTI - CAPpotiFT
for(i in c(2:8,15)) CAPpotiFTI$CCA[[i]][, 1]-CAPpotiFTI$CCA[[i]][, 1]
* -1

Cheers, Mark.


Rodrigo Aluizio wrote:



[[elided Yahoo spam]]

Ah well, I tried the this other way, but it gave me an error.
Something in the syntax, I tried to change something but didn't fix the
error.

CAPpotiFTI-CAPpotiFT
 for(i in c(2:8,15))
CAPpotiFTI$CCA[[i]][,2]-CAPpotiFTI,cca$CCA[[i]][,1]*-1
Erro: unexpected ',' in for(i in c(2:8,15))
CAPpotiFTI$CCA[[i]][,2]-CAPpotiFTI,

 for(i in c(2:8,15)) 
CAPpotiFTI$CCA[[i]][,1]-CAPpotiFTI$CCA[[i]][,1]*-1

Erro em CAPpotiFTI$CCA[[i]] : índice fora de limites (index out of
limits)

Well, it needs lots of patience...

--



Sent: Tuesday, October 07, 2008 3:50 PM
To: r-help@r-project.org
Subject: Re: [R] Mirror Image on Biplot Graphic



Hi Rodrigo,

Again an error, as that doesn't touch one of the data structures. You
need
to extend the range to include #15, as below:

## This does axis 2
mynew.cca - my.cca
for (i in c(2:8,15)) mynew.cca$CCA[[i]][, 2] - mynew,cca$CCA[[i]][, 
2]

* -1

Cheers, Mark.


Mark Difford wrote:


Hi Rodrigo,

I looked through my scripts and found my old hack. __WARNING__: Be
very
careful to check that
the mirror isn't broken and that all is in order! Make sure that you
are
reversing the axes you want. In your original post you mention axis 
2,

i.e. y-axis. Below you have used axis 1.

## This does axis 2
mynew.cca - my.cca
for (i in 2:8) mynew.cca$CCA[[i]][, 2] - mynew,cca$CCA[[i]][, 2] 
* -1


plot(mynew.cca)

## This does axis 1
for (i in 2:8) mynew.cca$CCA[[i]][, 1] - mynew,cca$CCA[[i]][, 1] 
* -1


Regards, Mark.


Rodrigo Aluizio wrote:


Ok Mark, it worked for the species.
I still get an error if I try with biplot (cn,sp), but it's not a
problem,
repositioning the species is enough.
Thanks once again.

Just for future consults the error that still remains

[R] Mirror Image on Biplot Graphic

2008-10-03 Thread Rodrigo Aluizio
He everybody,
Well I have a biplot CCA-like origined from plot.cca (vegan package). I need to 
rotate on y axis the lines and symbols of constrained and sites representation. 
If I do that on an image editor, I rotate everything, including titles, axes 
labels and positions. I just need to rotate the inner par and keep the 
variables names (constrained) and symbols in the new positions but with the 
right direction.
So, is there on R a way to do that while creating the image?
Here is the code that generate the graphic.

plot.cca(CAPpotiFT,type='none',display=c('bp','sites'),main='Total Fauna
Sites x Environment')
text.cca(CAPpotiFT,dis='cn',col='black',cex=0.6,lwd=0.5,lty='dotted')
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='1',],pch=21)
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='2',],pch=20)
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='3',],pch=22,bg='gray')
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='4',],pch=24)
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='5',],pch=24,bg='black')
points(ScoresCAPFT$sites[FatoresRep$BiofaciesBC=='6',],pch=25,bg='gray')

Thanks in advice.
___
MSc. Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - BRASIL
Fone: (0**41) 3455-1496 ramal 217
Fax: (0**41) 3455-1105

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Fatal error .RData

2008-09-18 Thread Rodrigo Aluizio
If the students have the permission, maybe run R as administrator solves the 
question too.


Rodrigo.

--
From: Duncan Murdoch [EMAIL PROTECTED]
Sent: Thursday, September 18, 2008 10:48 AM
To: Green, Paul [EMAIL PROTECTED]
Cc: r-help@r-project.org
Subject: Re: [R] Fatal error .RData


On 18/09/2008 9:41 AM, Green, Paul wrote:

We are using R in our class. One student claims to
be receiving the message

Fatal error: unable to restore saved data in .RData

The student is working in a Windows environment with Vista
using the precompiled binary distribution (R-2.7.2).

After searching the R site and reading FAQs, I suggested
the student find .RData in the working directory and delete it.

The student claims this did not work so I recommended starting
R from a command line with the --no-restore option.

Has anyone had any experience with this? Does anyone know
what may be causing this? This is the first time I have
encountered this.


Your advice was right:  something is wrong with .RData, and the solution 
is not to try to read it.


Likely if deleting .RData failed to solve the problem, it's because the 
wrong one was deleted.  But running with --no-restore will skip reading 
what's there, and saving the workspace will probably overwrite the right 
one (assuming the student has the necessary file system permissions to do 
that).


Duncan Murdoch

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html

and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Saving a TukeyHSD object as a table

2008-09-18 Thread Rodrigo Aluizio
Hi everybody.
I have a TukeyHSD object (as fallows):

$Biofacies
   difflwrupr p adj
2-1  2.04392007  0.8128809  3.2749592 0.0001406
3-1 -0.14727913 -1.4102987  1.1157404 0.9993065
4-1 -0.63337954 -1.8963991  0.6296400 0.6738977
5-1 -0.38314928 -1.6461688  0.8798703 0.9447638
6-1 -0.58739330 -1.8504128  0.6756262 0.7390480
3-2 -2.19119920 -3.4222384 -0.9601600 0.420
4-2 -2.67729960 -3.9083388 -1.4462604 0.007
5-2 -2.42706935 -3.6581085 -1.1960302 0.058
6-2 -2.63131337 -3.8623525 -1.4002742 0.010
4-3 -0.48610041 -1.7491199  0.7769191 0.8616004
5-3 -0.23587015 -1.4988897  1.0271494 0.9934682
6-3 -0.44011417 -1.7031337  0.8229054 0.9043453
5-4  0.25023026 -1.0127893  1.5132498 0.9914204
6-4  0.04598624 -1.2170333  1.3090058 0.978
6-5 -0.20424402 -1.4672636  1.0587755 0.9966714

I'm trying to save (export) it as a table to txt or xls format but I can't.
Every time I try I got the fallowing messages.

 write.table(TukeySS,'TukeySS.txt')
Erro em as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = 
stringsAsFactors) : 
  c(cannot coerce class \multicomp\ into a data.frame, cannot coerce class 
\TukeyHSD\ into a data.frame)
 write.xls(TukeySS,'TukeySS.xls')
Erro em write.xls(TukeySS, TukeySS.xls) : 
  Currently the following types are supported: REALSXP (double), INTSXP 
(integer), LGLSXP 

Well I understood that it's not in table format, but there isn't anyway to 
create a table with this object?
I wasn't able to find anything about it in the R documentation.

Thanks in advice.
___
MSc. Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - BRASIL

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Saving a TukeyHSD object as a table

2008-09-18 Thread Rodrigo Aluizio
Nevermind people, I just got it easily
just realized that what I wanted is inside the object.
So...

write.xls(TukeySS$Biofacies,'TukeySS.xls')

Solved the problem.

Thanks anyway.


From: Rodrigo Aluizio 
Sent: Thursday, September 18, 2008 6:06 PM
To: R Help 
Subject: Saving a TukeyHSD object as a table


Hi everybody.
I have a TukeyHSD object (as fallows):

$Biofacies
   difflwrupr p adj
2-1  2.04392007  0.8128809  3.2749592 0.0001406
3-1 -0.14727913 -1.4102987  1.1157404 0.9993065
4-1 -0.63337954 -1.8963991  0.6296400 0.6738977
5-1 -0.38314928 -1.6461688  0.8798703 0.9447638
6-1 -0.58739330 -1.8504128  0.6756262 0.7390480
3-2 -2.19119920 -3.4222384 -0.9601600 0.420
4-2 -2.67729960 -3.9083388 -1.4462604 0.007
5-2 -2.42706935 -3.6581085 -1.1960302 0.058
6-2 -2.63131337 -3.8623525 -1.4002742 0.010
4-3 -0.48610041 -1.7491199  0.7769191 0.8616004
5-3 -0.23587015 -1.4988897  1.0271494 0.9934682
6-3 -0.44011417 -1.7031337  0.8229054 0.9043453
5-4  0.25023026 -1.0127893  1.5132498 0.9914204
6-4  0.04598624 -1.2170333  1.3090058 0.978
6-5 -0.20424402 -1.4672636  1.0587755 0.9966714

I'm trying to save (export) it as a table to txt or xls format but I can't.
Every time I try I got the fallowing messages.

 write.table(TukeySS,'TukeySS.txt')
Erro em as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = 
stringsAsFactors) : 
  c(cannot coerce class \multicomp\ into a data.frame, cannot coerce class 
\TukeyHSD\ into a data.frame)
 write.xls(TukeySS,'TukeySS.xls')
Erro em write.xls(TukeySS, TukeySS.xls) : 
  Currently the following types are supported: REALSXP (double), INTSXP 
(integer), LGLSXP 

Well I understood that it's not in table format, but there isn't anyway to 
create a table with this object?
I wasn't able to find anything about it in the R documentation.

Thanks in advice.
___
MSc. Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - BRASIL

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Converting Geo-Coordinates Unities

2008-09-16 Thread Rodrigo Aluizio
Hi everybody,
I'm looking for some package or function of R that can convert Coordinates of 
Longitude and Latitude in different formats, such like: Deg and decimals, UTM, 
degree minutes and seconds, etc...
I'm found something (Proj4 package) but I'm note sure if it's what I need.
I have a sheet with tree columns, the first has the sample identification, the 
second and third have the Longitude and Latitude, respectively in D M' S''. I 
need to transform it into Degrees and decimals.
I know that I can create a function with some basic mathematics to this one, 
but I'll need to convert other formats in the future and it won't be that easy. 
So, any suggestion well be appreciated.
Thanks in advice.
___
MSc. Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Converting Geo-Coordinates Unities

2008-09-16 Thread Rodrigo Aluizio

Thanks for the elucidation James.
After reading the .pdf of proj4 and your answer, I believe I won't need 
proj4 package.
Well, I still don't know all the kind of transformations we will need here. 
I'm just getting prepared to future data that is arriving soon.

Each time they come, there is a different coordinate unit...
I'll star elaborating the mathematic functions for conversions, and save 
them in a safe place!

Anyway thank you so much!

Rodrigo.

--
From: James Muller [EMAIL PROTECTED]
Sent: Tuesday, September 16, 2008 1:48 PM
To: R Help r-help@r-project.org
Subject: Re: [R] Converting Geo-Coordinates Unities


I'd recommend just using a simple function for this particular thing,
and then use proj4 for complicated geographical transforms. This is
such an elementary operation it's not worth getting involved proj4,
which, as far as I'm aware, doesn't bother doing what you're wanting
anyway.

Now, proj4. What other sorts of transformations are you likely to be
doing? Do you know the ins-and-outs of projections and datums?

If not, you'll really need to learn something about these in order to
use proj4 correctly.

James

On Tue, Sep 16, 2008 at 12:35 PM, Rodrigo Aluizio [EMAIL PROTECTED] 
wrote:

Hi everybody,
I'm looking for some package or function of R that can convert 
Coordinates of Longitude and Latitude in different formats, such like: 
Deg and decimals, UTM, degree minutes and seconds, etc...
I'm found something (Proj4 package) but I'm note sure if it's what I 
need.
I have a sheet with tree columns, the first has the sample 
identification, the second and third have the Longitude and Latitude, 
respectively in D M' S''. I need to transform it into Degrees and 
decimals.
I know that I can create a function with some basic mathematics to this 
one, but I'll need to convert other formats in the future and it won't be 
that easy. So, any suggestion well be appreciated.

Thanks in advice.
___
MSc. Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
   [[alternative HTML version deleted]]


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html

and provide commented, minimal, self-contained, reproducible code.




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html

and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Ward's Clustering Doubts

2008-09-14 Thread Rodrigo Aluizio
Hi Everybody,

Now I have a doubt that is more statistical than R's technical. I’m working 
with ecology of recent Foraminifera.

At the lab we used to perform cluster analysis using 1-Pearson’s R and Wards 
method (we already saw it in bibliography of the area) which renders good 
results with our biological data. Recently, using “R” Software (vegan and 
Cluster packages) which allows the combination of any kind of distances matrix 
with any clustering method, we tried to used Bray Curtis + Wards (which seem to 
be more appropriate to a matrix with a lot of zeros) and it renders a better 
result. Furthermore, the results agree with our hypothesis and with the results 
we have got with the Distance-based Redundancy Analysis - dbRDA or CAP. It 
means, the analysis (Q-mode) clusters the stations according to the main 
physical, sedimentary and biological characteristics of the study area.

We received some critical comments noticing that Wards Method accepts Euclidean 
Distance only. So, we made the analysis again using Euclidean Distance but we 
don’t get the better results we had using 1-Pearson’s R + Wards or Bray Curtis 
+ Wards (actually any other distance + method combination rendered better 
results). Trying to find answers in the specialized literature we just got 
little more confused because in any moment we saw something like You must use 
it with Euclidean Distance and like I said above we already saw in some 
articles from respected journals, other kind of distance associated with the 
Ward's Clustering method. 

Is it wrong or is it “non sense” to do the analysis in the way we were doing?

The results with Wards combined with 1-Pearson’s R or Bray Curtis fit better 
with our hypothesis and have excellent agglomerative coefficients , but we 
don’t want to make inappropriate statistical procedures. I'm starting to 
realize how powerful R is, but it doesn't justify doing nonsense statistics...  
I hope one of you may help us!

Thank you in advance.

Rodrigo.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Ward's Clustering Doubts

2008-09-14 Thread Rodrigo Aluizio
Hi Everybody,
Now I have a doubt that is more statistical than R's technical. I’m working 
with ecology of recent Foraminifera.

At the lab we used to perform cluster analysis using 1-Pearson’s R and Wards 
method (we already saw it in bibliography of the area) which renders good 
results with our biological data. Recently, using “R” Software (vegan and 
Cluster packages) which allows the combination of any kind of distances matrix 
with any clustering method, we tried to used Bray Curtis + Wards (which seem to 
be more appropriate to a matrix with a lot of zeros) and it renders a better 
result. Furthermore, the results agree with our hypothesis and with the results 
we have got with the Distance-based Redundancy Analysis - dbRDA or CAP. It 
means, the analysis (Q-mode) clusters the stations according to the main 
physical, sedimentary and biological characteristics of the study area.

We received some critical comments noticing that Wards Method accepts Euclidean 
Distance only. So, we made the analysis again using Euclidean Distance but we 
don’t get the better results we had using 1-Pearson’s R + Wards or Bray Curtis 
+ Wards (actually any other distance + method combination rendered better 
results). Trying to find answers in the specialized literature we just got 
little more confused because in any moment we saw something like You must use 
it with Euclidean Distance and like I said above we already saw in some 
articles from respected journals, other kind of distance associated with the 
Ward's Clustering method. 

Is it wrong or is it “non sense” to do the analysis in the way we were doing?

The results with Wards combined with 1-Pearson’s R or Bray Curtis fit better 
with our hypothesis and have excellent agglomerative coefficients , but we 
don’t want to make inappropriate statistical procedures. I'm starting to 
realize how powerful R is, but it doesn't justify doing nonsense statistics...  
I hope one of you may help us!

Thank you in advance.

Rodrigo.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Symbols On a Capscale Object Biplot

2008-09-13 Thread Rodrigo Aluizio

Hi, I'm a beginner with R, but I'm getting excellent results with it.
Well I've got an capscale object (vegan package) and I want to made a biplot 
with symbols representing six groups of areas.
With the plot.cca function and some par attributes (like 'labels') I was 
able to substitute the samples names for keyboard symbols ('x','o','#',ect), 
but it's far from the ideal.
I've already search about it and find something using 'Hershey' fonts 
symbols for a scatterplot, but it didn't work for the biplot (capscale 
object).
I would like to use something like squares, triangles and circles (filled 
and empty).

Does anyone have and idea to solve it?
Thank you for your attention and patience
Sorry if the English is not that good, I'm Brazilian.

Here is the script I'm using!

# The analysis
library(vegan)
library(xlsReadWrite)
PotiAbio-read.xls('PotiAbioCanoco.xls',sheet=1,rowNames=T)
PotiBio-read.xls('FatorialReplica.xls',sheet=8,rowNames=T)
attach(PotiAbio)
LogPotiBio-log(PotiBio+1)
dbRDA-capscale(t(LogPotiBio)~Environmental Variables,dist=bray,add=T)
dbRDA

#Preparing to generate and save the graphic
SymbolsRep-read.xls('Fatores.xls',sheet=2)
tiff('dbRDAPontos.tif',width=1250,height=1250,res=150)
plot.cca(dbRDA,type='none',display=c('bp','sites'))
text.cca(dbRDA,dis='cn',col=323232,cex=0.7,lwd=2,lty='dotted')
text.cca(dbRDA,dis='sites',col='black',cex=0.8,labels=FatoresSymbols$RepSimb)
dev.off()
___
MSc. Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - BRASIL
Fone: (0**41) 3455-1496 ramal 217
Fax: (0**41) 3455-1105

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Symbols on a capscale object plot

2008-09-13 Thread Rodrigo Aluizio

Hi, I'm a beginner with R, but I'm getting excellent results with it.
Well I've got an capscale object (vegan package) and I want to made a biplot
with symbols representing six groups of areas.
With the plot.cca function and some par attributes (like 'labels') I was
able to substitute the samples names for keyboard symbols ('x','o','#',ect),
but it's far from the ideal.
I've already search about it and find something using 'Hershey' fonts
symbols for a scatterplot, but it didn't work for the biplot (capscale
object).
I would like to use something like squares, triangles and circles (filled
and empty).
Does anyone have and idea to solve it?
Thank you for your attention and patience
Sorry if the English is not that good, I'm Brazilian.

Here is the script I'm using!

# The analysis
library(vegan)
library(xlsReadWrite)
PotiAbio-read.xls('PotiAbioCanoco.xls',sheet=1,rowNames=T)
PotiBio-read.xls('FatorialReplica.xls',sheet=8,rowNames=T)
attach(PotiAbio)
LogPotiBio-log(PotiBio+1)
dbRDA-capscale(t(LogPotiBio)~Environmental Variables,dist=bray,add=T)
dbRDA

#Preparing to generate and save the graphic
SymbolsRep-read.xls('Fatores.xls',sheet=2)
tiff('dbRDAPontos.tif',width=1250,height=1250,res=150)
plot.cca(dbRDA,type='none',display=c('bp','sites'))
text.cca(dbRDA,dis='cn',col=323232,cex=0.7,lwd=2,lty='dotted')
text.cca(dbRDA,dis='sites',col='black',cex=0.8,labels=FatoresSymbols$RepSimb)
dev.off()
___
MSc. Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - BRASIL
Fone: (0**41) 3455-1496 ramal 217
Fax: (0**41) 3455-1105

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Symbols on a capscale object plot

2008-09-13 Thread Rodrigo Aluizio

Thank You Mark,
With your tip now I'm able to chance the sites names for real symbols. Well,
now I just have to find out how to change groups of sites names, that
compose a 'biofacies', with different symbols (actually six groups) in the
same plot.
Maybe if I can define a factor that specifies these groups and use this
factor to assign the symbols.
I don't know, I've to try, but I'm getting something, I hope.

Rodrigo.

--

From: Mark Difford [EMAIL PROTECTED]
Sent: Saturday, September 13, 2008 9:21 AM
To: r-help@r-project.org
Subject: Re: [R] Symbols on a capscale object plot



Hi Rodrigo,

I would like to use something like squares, triangles and circles 
(filled

and empty).


You would normally add this using points():
?points

##
plot(1:10, type=n)
points(1:5, pch=21:25, bg=1:5)
points(6:10, pch=21:25, bg=c(1,darkgrey,cyan, bisque))
points(6:10, y=rep(6,5), pch=1:5)


I don't know what vegan is doing at the moment but there used to be a 
points
command for doing this (sub ordiplot, I think). Vegan mostly still uses 
base

graphics so you can always get your scores [via: scores(ord.object): see
?scores] from your saved ordination object and add them as per above.

Regards, Mark.


Rodrigo Aluizio wrote:


Hi, I'm a beginner with R, but I'm getting excellent results with it.
Well I've got an capscale object (vegan package) and I want to made a
biplot
with symbols representing six groups of areas.
With the plot.cca function and some par attributes (like 'labels') I was
able to substitute the samples names for keyboard symbols
('x','o','#',ect),
but it's far from the ideal.
I've already search about it and find something using 'Hershey' fonts
symbols for a scatterplot, but it didn't work for the biplot (capscale
object).
I would like to use something like squares, triangles and circles 
(filled

and empty).
Does anyone have and idea to solve it?
Thank you for your attention and patience
Sorry if the English is not that good, I'm Brazilian.

Here is the script I'm using!

# The analysis
library(vegan)
library(xlsReadWrite)
PotiAbio-read.xls('PotiAbioCanoco.xls',sheet=1,rowNames=T)
PotiBio-read.xls('FatorialReplica.xls',sheet=8,rowNames=T)
attach(PotiAbio)
LogPotiBio-log(PotiBio+1)
dbRDA-capscale(t(LogPotiBio)~Environmental 
Variables,dist=bray,add=T)

dbRDA

#Preparing to generate and save the graphic
SymbolsRep-read.xls('Fatores.xls',sheet=2)
tiff('dbRDAPontos.tif',width=1250,height=1250,res=150)
plot.cca(dbRDA,type='none',display=c('bp','sites'))
text.cca(dbRDA,dis='cn',col=323232,cex=0.7,lwd=2,lty='dotted')
text.cca(dbRDA,dis='sites',col='black',cex=0.8,labels=FatoresSymbols$RepSimb)
dev.off()
___
MSc. Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - BRASIL
Fone: (0**41) 3455-1496 ramal 217
Fax: (0**41) 3455-1105

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.




--
View this message in context: 
http://www.nabble.com/Symbols-on-a-capscale-object-plot-tp19469679p19470027.html

Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html

and provide commented, minimal, self-contained, reproducible code.



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Symbols on a Capsacale Object

2008-09-12 Thread Rodrigo Aluizio
Hi, I'm a beginner with R, but I'm getting excellent results with it.
Well I've got an capscale object (vegan package) and I want to made a biplot 
with symbols representing six groups of areas.
The plot.cca function and some par attributes (like 'labels') I was able to 
substitute the samples names for keyboard symbols ('x','o','#',ect), but it's 
far from the ideal.
I've already search about it and find something using 'Hershey' fonts symbols 
for a scatterplot, but it didn't work for the biplot (capscale object).
I would like to use something like squares, triangles and circles (filled and 
empty).
Does anyone have and idea to solve it?
Thank you for your attention and patience
Sorry if the English is not that good, I'm Brazilian.

Here is the script I'm using!

# The analysis
library(vegan)
library(xlsReadWrite)
PotiAbio-read.xls('PotiAbioCanoco.xls',sheet=1,rowNames=T)
PotiBio-read.xls('FatorialReplica.xls',sheet=8,rowNames=T)
attach(PotiAbio)
LogPotiBio-log(PotiBio+1)
dbRDA-capscale(t(LogPotiBio)~Environmental Variables,dist=bray,add=T)
dbRDA

#Preparing to generate and save the graphic
SymbolsRep-read.xls('Fatores.xls',sheet=2)
tiff('dbRDAPontos.tif',width=1250,height=1250,res=150)
plot.cca(dbRDA,type='none',display=c('bp','sites'))
text.cca(dbRDA,dis='cn',col=323232,cex=0.7,lwd=2,lty='dotted')
text.cca(dbRDA,dis='sites',col='black',cex=0.8,labels=FatoresSymbols$RepSimb)
dev.off()
___
MSc. Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laboratório de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paraná - PR - BRASIL
Fone: (0**41) 3455-1496 ramal 217
Fax: (0**41) 3455-1105

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.