[R] eps file
Dear All, I need to create eps file which is the required figure format of the journal that I want to submit a paper. I am able to create files in pdf or wmf format but not in eps format. Is there a way to convert pdf or wmf to eps? or alternatively, how can I create an eps file in R? Any help is deeply appreciated. Kind Regards Seyit Ali Dr. Seyit Ali KAYIS Selcuk University, Faculty of Agriculture Kampus/Konya, Turkey Tel: +90 332 223 2830 Mobile: +90 535 587 1139 Greetings from Konya, Turkey http://www.ziraat.selcuk.edu.tr/skayis/ [[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] accumulation curves
Hi Kyran, Please reply via the list - you'll get more answers that way :) My example had the data in vectors, you are using a data.frame. Try replacing the relevant bits of your code (below) with these lines and see if that helps... rich.lm ~ lm(Chao1 ~ log(N.obs), data=table1) smooth.effort <- seq(0,54,0.1) lines(smooth.effort, predict(rich.lm, newdata=list(N.obs=smooth.effort)), col="red") Michael On 23 September 2010 18:06, Kyran Staunton wrote: > Ok so using your additions my script is.. > > library(adehabitat) > in.dir = in.dir="D:/R output/Richness/BK12SR.csv" > out.dir = "D:/R output/Richness/" > table1= read.csv(file =in.dir) > > y_range <- range(1:15) > x_range = range(0,60) > > png(filename="D:/R output/Richness/BK12SR.png", height=800, > width=1500, bg="white") > par(mfrow = c(1, 1), pty = "m", ps=15,cex.main=0.9,mar=c(5,7,4,7)) > > plot(table1$Chao1~table1$N.obs, ann=FALSE, axes=TRUE, ylim=y_range, > xlim=x_range, cex=1) > rich.lm <- lm(table1$Chao1~ log (table1$N.obs)) > smooth.effort <- seq(0,54,0.1) > lines(smooth.effort, predict(rich.lm, > newdata=list(table1$N.obs=smooth.effort)), col="red") > > title(xlab= "Samples") > title(ylab= "Chao1 (mean)") > box() > dev.off() > > #I have 54 samples (N.obs) and about 14 species (Chao1) > > R won't run the line as it states.. > > Error: unexpected '=' in "lines(smooth.effort, predict(rich.lm, > newdata=list(table1$N.obs=" > > Can you please decipher this error, > > Thank you very much for your time > > Kyran. > > On 23 September 2010 17:36, Michael Bedward wrote: >> OK, assuming a trend in estimated spp richness vs log(effort) you >> could do this... >> >> plot(effort, richness) >> rich.lm <- lm( richness ~ log(effort) ) >> smooth.effort <- seq(1, 10, 0.1) # or whatever is appropriate >> lines( smooth.effort, predict(rich.lm, >> newdata=list(effort=smooth.effort)), col="red" ) >> >> Is that the sort of thing that you're after ? >> >> Michael >> >> >> On 23 September 2010 17:07, Kyran Staunton wrote: >>> Sorry Michael, >>> >>> Yes it surely is, Chao1 species richness increase per sampling effort >>> run through fossil. >>> >>> cheers, >>> >>> Kyran >>> >>> On 23 September 2010 16:58, Michael Bedward >>> wrote: Hello Kyran, Some more details of your data would be helpful. For example, is it cumulative species count over time ? Michael On 23 September 2010 15:05, Kyran Staunton wrote: > Hi, > > I am trying to fit a logarithmic trendline to a scatterplot of a > species accumulation curve. I've tried abline, lines, curve and > scatter.smooth but none of these work. > > Can anyone help please, > > Kyran > > __ > 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] lattice centre a diverging colour scale
Great, I don't know how I missed that, thanks! baptiste On Sep 23, 2010, at 10:39 AM, Deepayan Sarkar wrote: > On Thu, Sep 23, 2010 at 12:33 PM, baptiste auguie > wrote: >> Dear list, >> >> I'm using lattice::levelplot to plot a coloured image of 3D data. The >> range of the z values goes from negative to positive, but is not >> exactly centred around 0. I would however like to map a diverging >> colour scale with white falling exactly at 0, and both extremes being >> symmetrical in the legend to better contrast the opposite change in >> colour saturation. The following dummy example illustrates my problem, >> >> >> library(lattice) >> d <- transform(expand.grid(x=seq(0, 10, length=100), >> y=seq(0, 10, length=100)), >> z = sin(x/pi)*cos(0.5*y/pi) - 0.2) >> >> levelplot(z~x*y, data=d, >> panel=panel.levelplot.raster, >> cuts = 100, interpolate = TRUE) >> >> The colour scale goes from -0.3 to 0.9 with a middle (white) value of >> 0.3 approximately. I'd like it to be from -1 (most saturated blue) to >> 1 (most saturated pink), say, with 0 being white. >> >> I read the entry in ?levelplot and in ?level.colors but could not find >> a solution to this particular case. > > Specify the cut-points explicitly: > > levelplot(z~x*y, data=d, panel = panel.levelplot.raster, at = > do.breaks(c(-1, 1), 100)) > > -Deepayan __ 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] lattice centre a diverging colour scale
On Thu, Sep 23, 2010 at 12:33 PM, baptiste auguie wrote: > Dear list, > > I'm using lattice::levelplot to plot a coloured image of 3D data. The > range of the z values goes from negative to positive, but is not > exactly centred around 0. I would however like to map a diverging > colour scale with white falling exactly at 0, and both extremes being > symmetrical in the legend to better contrast the opposite change in > colour saturation. The following dummy example illustrates my problem, > > > library(lattice) > d <- transform(expand.grid(x=seq(0, 10, length=100), > y=seq(0, 10, length=100)), > z = sin(x/pi)*cos(0.5*y/pi) - 0.2) > > levelplot(z~x*y, data=d, > panel=panel.levelplot.raster, > cuts = 100, interpolate = TRUE) > > The colour scale goes from -0.3 to 0.9 with a middle (white) value of > 0.3 approximately. I'd like it to be from -1 (most saturated blue) to > 1 (most saturated pink), say, with 0 being white. > > I read the entry in ?levelplot and in ?level.colors but could not find > a solution to this particular case. Specify the cut-points explicitly: levelplot(z~x*y, data=d, panel = panel.levelplot.raster, at = do.breaks(c(-1, 1), 100)) -Deepayan __ 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] dnorm
On 09/23/2010 05:42 PM, "Sibylle Stöckli" wrote: Dear R-users Idea: Plot a dnorm line using specific mean/sd to complete a histogram (skewed). xs:range of y-values, ys: dnorm function Problem: I expected to multiply the ys function with the sample size (n=250-300). I was wondering about a factor between 12'000 and 30'000 to match the size of the dnorm line with the specific histogram. Thanks Sibylle hist(Biotree[Ld,]$Height2008, main="Larix decidua", ylim=c(0,50), xlab="Tree Height 2008 (cm)",col="aquamarine", font.main=3, cex.axis=0.8) xs<-0:650 ys<-dnorm(xs, mean=397.8, sd=97.6) lines(xs,ys*12000) Hi Sibylle, You can use one of the "rescale" functions (one is in the plotrix package) like this: Ld.hist<-hist(Biotree[Ld,]$Height2008, main="Larix decidua", ylim=c(0,50), xlab="Tree Height 2008 (cm)", col="aquamarine", font.main=3,cex.axis=0.8) xs<-0:650 ys<-dnorm(xs, mean=397.8, sd=97.6) lines(xs,rescale(ys,0:max(Ld.hist))) 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] Help me pls
> From: Seyit Ali KAYIS > To: r-help@r-project.org > Sent: Thu, September 23, 2010 12:12:49 AM > Subject: [R] Help me pls > > Dear All, > > I need to create eps file which is the required figure format of the > journal that I want to submit a paper. I am able to create files in pdf or > wmf format but not in eps format. Is there a way to convert pdf or wmf to > eps? or alternatively, how can I create an eps file in R? ?postscript In particular: The postscript produced for a single R plot is EPS (_Encapsulated PostScript_) compatible, and can be included into other documents, e.g., into LaTeX, using ‘\includegraphics{}’. For use in this way you will probably want to use ‘setEPS()’ to set the defaults as ‘horizontal = FALSE, onefile = FALSE, paper = "special"’. Note that the bounding box is for the _device_ region: if you find the white space around the plot region excessive, reduce the margins of the figure region via ‘par(mar=)’. -- Mike __ 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] dnorm
Dear R-users Idea: Plot a dnorm line using specific mean/sd to complete a histogram (skewed). xs:range of y-values, ys: dnorm function Problem: I expected to multiply the ys function with the sample size (n=250-300). I was wondering about a factor between 12'000 and 30'000 to match the size of the dnorm line with the specific histogram. Thanks Sibylle hist(Biotree[Ld,]$Height2008, main="Larix decidua", ylim=c(0,50), xlab="Tree Height 2008 (cm)",col="aquamarine", font.main=3, cex.axis=0.8) xs<-0:650 ys<-dnorm(xs, mean=397.8, sd=97.6) lines(xs,ys*12000) -- GMX DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für nur 19,99 Euro/mtl.!* __ 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] Help me pls
The postscript function ? On 23 September 2010 17:12, Seyit Ali KAYIS wrote: > Dear All, > > I need to create eps file which is the required figure format of the > journal that I want to submit a paper. I am able to create files in pdf or > wmf format but not in eps format. Is there a way to convert pdf or wmf to > eps? or alternatively, how can I create an eps file in R? > > Any help is deeply appreciated. > > Kind Regards > > Seyit Ali > > __ > 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] accumulation curves
OK, assuming a trend in estimated spp richness vs log(effort) you could do this... plot(effort, richness) rich.lm <- lm( richness ~ log(effort) ) smooth.effort <- seq(1, 10, 0.1) # or whatever is appropriate lines( smooth.effort, predict(rich.lm, newdata=list(effort=smooth.effort)), col="red" ) Is that the sort of thing that you're after ? Michael On 23 September 2010 17:07, Kyran Staunton wrote: > Sorry Michael, > > Yes it surely is, Chao1 species richness increase per sampling effort > run through fossil. > > cheers, > > Kyran > > On 23 September 2010 16:58, Michael Bedward wrote: >> Hello Kyran, >> >> Some more details of your data would be helpful. For example, is it >> cumulative species count over time ? >> >> Michael >> >> On 23 September 2010 15:05, Kyran Staunton wrote: >>> Hi, >>> >>> I am trying to fit a logarithmic trendline to a scatterplot of a >>> species accumulation curve. I've tried abline, lines, curve and >>> scatter.smooth but none of these work. >>> >>> Can anyone help please, >>> >>> Kyran >>> >>> __ >>> 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 me pls
Dear All, I need to create eps file which is the required figure format of the journal that I want to submit a paper. I am able to create files in pdf or wmf format but not in eps format. Is there a way to convert pdf or wmf to eps? or alternatively, how can I create an eps file in R? Any help is deeply appreciated. Kind Regards Seyit Ali __ 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] lattice centre a diverging colour scale
Dear list, I'm using lattice::levelplot to plot a coloured image of 3D data. The range of the z values goes from negative to positive, but is not exactly centred around 0. I would however like to map a diverging colour scale with white falling exactly at 0, and both extremes being symmetrical in the legend to better contrast the opposite change in colour saturation. The following dummy example illustrates my problem, library(lattice) d <- transform(expand.grid(x=seq(0, 10, length=100), y=seq(0, 10, length=100)), z = sin(x/pi)*cos(0.5*y/pi) - 0.2) levelplot(z~x*y, data=d, panel=panel.levelplot.raster, cuts = 100, interpolate = TRUE) The colour scale goes from -0.3 to 0.9 with a middle (white) value of 0.3 approximately. I'd like it to be from -1 (most saturated blue) to 1 (most saturated pink), say, with 0 being white. I read the entry in ?levelplot and in ?level.colors but could not find a solution to this particular case. Sincerely, baptiste __ 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.