[R] how can i add Qtr1 Qtr2 Qtr3 Qtr4 on the x axis?

2013-12-15 Thread ????????
> x<-ts(sales,frequency=4,start=c(2010,1)) > x Qtr1 Qtr2 Qtr3 Qtr4 2010 1.8 8.0 6.0 3.0 2011 2.0 11.0 7.0 3.5 2012 2.5 14.0 8.0 4.2 2013 3.0 15.2 9.5 5.0 > plot.ts(x)__ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listi

[R] [Probable spam] RE: how can i add Qtr1 Qtr2 Qtr3 Qtr4 on the x axis?

2013-12-15 Thread Dániel Kehl
Hi, try ?axis.Date works similar to the axis function. I hope that helps! daniel Feladó: r-help-boun...@r-project.org [r-help-boun...@r-project.org] ; meghatalmazó: 水静流深 [1248283...@qq.com] Küldve: 2013. december 15. 9:17 To: r-help Tárgy: [R] how can i

[R] why there is no quarters?

2013-12-15 Thread ????????
seq(as.Date("2001/1/1"),as.Date("2010/1/1"),"years") seq(as.Date("2001/1/1"),as.Date("2010/1/1"),"weeks") seq(as.Date("2001/1/1"),as.Date("2010/1/1"),"days") why there is no seq(as.Date("2001/1/1"),as.Date("2010/1/1"),"quarters") ? [[alternative HTML version deleted]] __

[R] why as.vector can't make x to be a vector?

2013-12-15 Thread ????????
> x=read.table(text=" + Qtr1 Qtr2 Qtr3 Qtr4 + 2010 1.8 8.0 6.0 3.0 + 2011 2.0 11.0 7.0 3.5 + 2012 2.5 14.0 8.0 4.2 + 2013 3.0 15.2 9.5 5.0",sep="",header=TRUE) > x Qtr1 Qtr2 Qtr3 Qtr4 2010 1.8 8.0 6.0 3.0 2011 2.0 11.0 7.0 3.5 2012 2.5 14.0 8.0 4.2 2013 3.0 15.2 9.5

Re: [R] why there is no quarters?

2013-12-15 Thread Duncan Murdoch
On 13-12-15 6:43 AM, 水静流深 wrote: seq(as.Date("2001/1/1"),as.Date("2010/1/1"),"years") seq(as.Date("2001/1/1"),as.Date("2010/1/1"),"weeks") seq(as.Date("2001/1/1"),as.Date("2010/1/1"),"days") why there is no seq(as.Date("2001/1/1"),as.Date("2010/1/1"),"quarters") ? There's no need for it. Jus

Re: [R] why as.vector can't make x to be a vector?

2013-12-15 Thread Duncan Murdoch
On 13-12-15 6:48 AM, 水静流深 wrote: x=read.table(text=" + Qtr1 Qtr2 Qtr3 Qtr4 + 2010 1.8 8.0 6.0 3.0 + 2011 2.0 11.0 7.0 3.5 + 2012 2.5 14.0 8.0 4.2 + 2013 3.0 15.2 9.5 5.0",sep="",header=TRUE) x Qtr1 Qtr2 Qtr3 Qtr4 2010 1.8 8.0 6.0 3.0 2011 2.0 11.0 7.0 3.5 2012 2.5

[R] how to add a line in the graph?

2013-12-15 Thread ????????
t<--4:4 y<-c(5,7,10,13,15,16,14,12,11) plot(t,y,type="l") how can i add a curve y=0.83*t-0.44*t^2 in the graph? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do re

[R] [Probable spam]RE: how to add a line in the graph?

2013-12-15 Thread Dániel Kehl
t<- -4:4 y<-c(5,7,10,13,15,16,14,12,11) plot(t,y,type="l", ylim=c(-20,20)) curve(0.83*x-0.44*x^2, add=TRUE) I added ylim to plot so that your curve is on the graph. Maybe you wanted to use different parameters. Try going through a basic manual of R! daniel _

[R] RSM

2013-12-15 Thread IZHAK shabsogh
kindly help find out why the following code is given me error time<-c(80,80,90,90,85,85,85,85,85,85,92,77,85,85) > tem<-c(170,180,170,180,175,175,175,175,175,175,175,175,182.07,167.93) > yield<-c(80.5,81.5,82,83.5,83.9,84.3,84,79.7,79.8,79.5,78.4,75.6,78.6,77) > Block<-c("B1","B1","B1","B1","B1"

Re: [R] RSM

2013-12-15 Thread Dániel Kehl
There is no variable called x1 in the chem dataframe. Did you mean gg1=rsm(yield~ FO(x1,x2),data=ggg,subset = (Block == "B1")) hth. daniel Feladó: r-help-boun...@r-project.org [r-help-boun...@r-project.org] ; meghatalmazó: IZHAK shabsogh [ishaqb...@yahoo

[R] Simple way to define a function to be used in a formula object inside another function

2013-12-15 Thread Frank Harrell
I would like to do this: f <- function(formula, data=NULL) { gg <- sqrt model.frame(formula, data=data) } x <- y <- 1:10 f(y ~ gg(x)) Error in eval(expr, envir, enclos) : could not find function "gg" Is there a simple way to get access to gg from within the model.frame invocation inside f?

Re: [R] Simple way to define a function to be used in a formula object inside another function

2013-12-15 Thread William Dunlap
The following works because model.frame looks for things in environment(formula) and ancestral environments thereof. It puts the new things in a child environment of the original environment(formula) so it does not alter the original environment. f2 <- function (formula, data = NULL) { env

Re: [R] Invalid connection error message when trying to write a file

2013-12-15 Thread John Karon
The response below asks what I actually did. I defined a function (details omitted; it computes the data frame LRtest.out); arguments include "path\\filename.csv" to which I want to write a data frame using write.csv( ). Repeated executions of the function (without the file( ) and close( )

Re: [R] Invalid connection error message when trying to write a file

2013-12-15 Thread Uwe Ligges
On 15.12.2013 20:13, John Karon wrote: The response below asks what I actually did. I defined a function (details omitted; it computes the data frame LRtest.out); arguments include "path\\filename.csv" to which I want to write a data frame using write.csv( ). Repeated executions of the funct

Re: [R] why as.vector can't make x to be a vector?

2013-12-15 Thread David Carlson
According to the documentation (?as.vector), "All attributes are removed from the result if it is of an atomic mode, but not in general for a list result." data.frames are lists so > is.vector(as.vector(x)) [1] FALSE However if you convert using unlist() or as.matrix(), you will get a vector:

Re: [R] Simple way to define a function to be used in a formula object inside another function

2013-12-15 Thread Frank Harrell
Thank you Bill, that worked perfectly. Frank __ 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, r

[R] Exporting R graphics into Word without losing graph quality

2013-12-15 Thread david hamer
Hello, My x-y scatterplot produces a very ragged best-fit line when imported into Word. * >plot (data.file$x, data.file$y, type = "p", las=1, pch=20,ylab = expression("Cover of Species y" ~ (m^{2}~ha^{-1} )),xlab = expression("Cover of Species x" ~ (m^{2}~ha^{-1})) )>lines

Re: [R] Exporting R graphics into Word without losing graph quality

2013-12-15 Thread Henrik Bengtsson
See ?png and argument 'pointsize'. You can increase that as you increase the dimensions of the output image. /Henrik On Sun, Dec 15, 2013 at 3:00 PM, david hamer wrote: > Hello, > > My x-y scatterplot produces a very ragged best-fit line when imported into > Word. > > > > * >plot (data.file$x,

Re: [R] Exporting R graphics into Word without losing graph quality

2013-12-15 Thread Henrik Bengtsson
And possibly better, argument 'res', e.g. png("R.graph.png", width=1200, height = 700, res=144) plot(...) dev.off() Default corresponds to res=72. /Henrik On Sun, Dec 15, 2013 at 3:13 PM, Henrik Bengtsson wrote: > See ?png and argument 'pointsize'. You can increase that as you > increase the

Re: [R] Exporting R graphics into Word without losing graph quality

2013-12-15 Thread Duncan Murdoch
On 13-12-15 6:00 PM, david hamer wrote: Hello, My x-y scatterplot produces a very ragged best-fit line when imported into Word. Don't use a bitmap format (png). Don't produce your graph in one format (screen display), then convert to another (png). Open the device in the format you want for

Re: [R] Exporting R graphics into Word without losing graph quality

2013-12-15 Thread Rolf Turner
On 16/12/13 12:23, Duncan Murdoch wrote: [After a number of other "Don'ts"] Don't trust the preview to tell you the quality of the graph, try printing the document. Word isn't quite as bad as it appears. Don't use Word. Fortune? cheers, Rolf Turner _

[R] possible overflow/underflow error causing NaN in .trval when invoking trmat with degree 4

2013-12-15 Thread Nerd of Darkness
Hello all, I have two copies of the same data; I want to compare trend matrices for degrees 3 and 4, so I name the copies "triplo" and "quatro". > triploSurface<-surf.ls(3,triplo) > triploMat<-trmat(triploSurface,-150.,150.,-150.,150., 300) [This produces the expected triploSurface

Re: [R] how to add a line in the graph?

2013-12-15 Thread Frans Marcelissen
Hi, On itself one way of doing this is: lines(seq(-4,4,0.1),sapply(seq(-4,4,0.1),function(t)0.83*t-0.44*t^2)) The curve does not fit in the scale, however. Are you sure the formula is correct? Then you have to adapt the scale: plot.new() plot.window(xlim=c(-4,4), ylim=c(-10,16)) axis(1) axis(2) t

[R] Rows to Column

2013-12-15 Thread marcos.takahashi
Hi all, I'm kinda new in R programming and I need some help preparing a database to run logistic regression. I have data in a tuple form: *id cat val* 1 A 2 1 C 4 3 B 1 5 A 2 6 A 3 6 B 5 6 C 2 8 B 5 8 D 2 9 D 3 and would like to have it like: *id catA

Re: [R] The Stoppa distribution

2013-12-15 Thread andrewH
Thanks enormously, Bill! I'll run with this for a while, and let you know how it works for me. Yours, andrewH -- View this message in context: http://r.789695.n4.nabble.com/The-Stoppa-distribution-tp4682171p4682254.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] How can I find nonstandard or control characters in a large file?

2013-12-15 Thread Andrew Hoerner
Thanks, Enrico! I did this, and if I did it right, there are no nonstandard characters. So now I am suspecting a size limit internal to the filehash package, and trying to chase that down. Your help is much appreciated. On Mon, Dec 9, 2013 at 11:11 PM, Enrico Schumann wrote: > On Mon, 09 Dec 201

Re: [R] How can I find nonstandard or control characters in a large file?

2013-12-15 Thread andrewH
Thanks, Earl. Your utility ran like a charm, and confirmed that my effort to adapt Enrico's code to this purpose had not gone astray, which is to say, I found no funky characters. Your help is greatly appreciated. Sincerely, andrewH On Tue, Dec 10, 2013 at 7:35 AM, Earl F Glynn [via R] < ml-node+

[R] How to choose data from two sets of data to ensure that the choosed data has a better normal feature?

2013-12-15 Thread Marino David
Hi R mailing listers: Assume that there are two sets of data (denoted as A and B) with the same size, say 100X1. And I try to select a new set of data (100X1) that has a better normal feature from these two sets. Better normal feature means that the histogram shape of the constructed set of dat

[R] how to fit exponential curve such as a*b^t in r?

2013-12-15 Thread ????????
input <- " ty 1 5.3 2 7.2 3 9.6 4 12.9 5 17.1 6 23.2" dat<-read.table(textConnection(input),header=TRUE,sep="") t<-dat[,1] y<-dat[,2] `y=3.975*(1.341^t)` is the resule of fit,how can i use `nls`