Re: [R] The behaviour of read.csv().

2010-12-02 Thread Phil Spector
Rolf - I'd suggest using junk - read.csv(junk.csv,header=TRUE,fill=FALSE) if you don't want the behaviour you're seeing. - Phil Spector Statistical Computing Facility

[R] help with lme random = syntax and groupedData syntax

2010-12-02 Thread Huso, Manuela
Hello, all, I have a fairly complicated experimental design and would really appreciate some help on correctly specifying my random effects. I have a CRD split plot design with one covariate measured on the whole plot unit, one on the subplot unit and 2 other covariates measured on the

Re: [R] The behaviour of read.csv().

2010-12-02 Thread Rolf Turner
On 3/12/2010, at 1:08 PM, Phil Spector wrote: Rolf - I'd suggest using junk - read.csv(junk.csv,header=TRUE,fill=FALSE) if you don't want the behaviour you're seeing. The point is not that I don't want this kind of behaviour. The point is that it seems to me to be unexpected and

Re: [R] The behaviour of read.csv().

2010-12-02 Thread Peter Ehlers
On 2010-12-02 16:26, Rolf Turner wrote: On 3/12/2010, at 1:08 PM, Phil Spector wrote: Rolf - I'd suggest using junk- read.csv(junk.csv,header=TRUE,fill=FALSE) if you don't want the behaviour you're seeing. The point is not that I don't want this kind of behaviour. The point is

Re: [R] The behaviour of read.csv().

2010-12-02 Thread Duncan Murdoch
On 02/12/2010 8:04 PM, Peter Ehlers wrote: On 2010-12-02 16:26, Rolf Turner wrote: On 3/12/2010, at 1:08 PM, Phil Spector wrote: Rolf - I'd suggest using junk- read.csv(junk.csv,header=TRUE,fill=FALSE) if you don't want the behaviour you're seeing. The point is not that I

Re: [R] The behaviour of read.csv().

2010-12-02 Thread Rolf Turner
On 3/12/2010, at 2:04 PM, Peter Ehlers wrote: SNIP Rolf, This is not to argue with your point re counter-intuitive, but I always run a count.fields() first if I haven't seen (or can't easily see) the file in my editor. I must have learned that the hard way a long time ago. Sound

[R] Downloading a .csv through a .jsp url with variable parameters - R code or package?

2010-12-02 Thread Arsenio Staer
Dear R experts, I'm trying to download a .csv file with daily data on the companies through a javascript url ending in .jsp of the following form: http://... .com/.../.../filename.jsp?y=2004m=3d=9 where y = year, m = month and d=day. Accessing the link gives you the .csv for that date. I

[R] Strange problems with compiling dll

2010-12-02 Thread Oleksandr Dyklevych
Dear sir\madam! I'm trying to speed up my R code by writing quite simple dll's in C. But I faced some problems, and I cannot determine their source. #include Rinternals.h SEXP mycombin(SEXP N, SEXP k){ int i, *j, *l, c; j = INTEGER(k);l = INTEGER(N); c = 1; if(j[0] 0 j[0]

Re: [R] Tinn-R 2.3.7.0 released

2010-12-02 Thread Frank Black
Nice, but I'm still finding the same bug when communicating between R and Tinn-R: source(.trPaths[5], echo=TRUE, max.deparse.length=150) So I still have to use the last version of Tinn-R which doesn't have that problem (Tinn-R 1.19.4.7). Emili 2010/11/22 Jose Claudio Faria

Re: [R] The behaviour of read.csv().

2010-12-02 Thread David Winsemius
On Dec 2, 2010, at 8:33 PM, Duncan Murdoch wrote: snipped I think the fill=TRUE option arrived about 10 years ago, in R 1.2.0. The comment in the NEWS file suggests it was in response to some strange csv file coming out of Excel. The real problem with the CSV format is that there really

Re: [R] The behaviour of read.csv().

2010-12-02 Thread Duncan Murdoch
On 02/12/2010 9:18 PM, David Winsemius wrote: On Dec 2, 2010, at 8:33 PM, Duncan Murdoch wrote: snipped I think the fill=TRUE option arrived about 10 years ago, in R 1.2.0. The comment in the NEWS file suggests it was in response to some strange csv file coming out of Excel. The real

Re: [R] The behaviour of read.csv().

2010-12-02 Thread David Scott
On 03/12/10 14:33, Duncan Murdoch wrote: On 02/12/2010 8:04 PM, Peter Ehlers wrote: On 2010-12-02 16:26, Rolf Turner wrote: On 3/12/2010, at 1:08 PM, Phil Spector wrote: Rolf - I'd suggest using junk- read.csv(junk.csv,header=TRUE,fill=FALSE) if you don't want the behaviour

Re: [R] The behaviour of read.csv().

2010-12-02 Thread Rolf Turner
On 3/12/2010, at 3:48 PM, David Scott wrote: On 03/12/10 14:33, Duncan Murdoch wrote: SNIP I think the fill=TRUE option arrived about 10 years ago, in R 1.2.0. The comment in the NEWS file suggests it was in response to some strange csv file coming out of Excel. The real

[R] using ``-'' in function argument

2010-12-02 Thread Jinsong Zhao
Hi there, In function, it's usually using ``='' to assign default value for function argument. For newbie, it's possible to using ``- '' to assign value for function argument. Although it's not a correct way, R don't give any warning message. matrix(1:20, ncol - 4) [,1] [,2] [,3] [,4]

Re: [R] using ``-'' in function argument

2010-12-02 Thread Erik Iverson
On 12/02/2010 09:35 PM, Jinsong Zhao wrote: Hi there, In function, it's usually using ``='' to assign default value for function argument. For newbie, it's possible to using ``- '' to assign value for function argument. Although it's not a correct way, R don't give any warning message.

Re: [R] The behaviour of read.csv().

2010-12-02 Thread David Winsemius
On Dec 2, 2010, at 9:33 PM, Duncan Murdoch wrote: On 02/12/2010 9:18 PM, David Winsemius wrote: On Dec 2, 2010, at 8:33 PM, Duncan Murdoch wrote: snipped I think the fill=TRUE option arrived about 10 years ago, in R 1.2.0. The comment in the NEWS file suggests it was in response to some

[R] Replacing a period in a string

2010-12-02 Thread Luis Felipe Parra
Hello I have a sting of the form 12.084.547,17 which I would like R to understand as a number which has , as the decimal separator, does anybody know how to do this? thank you Felipe Parra [[alternative HTML version deleted]] __

[R] Writing to a file

2010-12-02 Thread Thomas Parr
From: Thomas Parr [mailto:thomas.p...@maine.edu] Sent: Thursday, December 02, 2010 10:52 PM To: r-help-requ...@stat.math.ethz.ch Subject: Writing to a file I am trying to get my script to write to a file from the for loop. It is working, but the problem is at it is outputting to two columns and

Re: [R] Writing to a file

2010-12-02 Thread Jorge Ivan Velez
Hi Thomas, If x contains your current results, one way to do what you want is the following: # data x - read.table(textConnection(X2403,0.006049271 X2403,0.000118622 X2403,50.99600705 X2403,7.62E-150 X2419,0.012464215 X2419,9.07E-05 X2419,137.4022573 X2419,6.45E-273), sep = ,)

Re: [R] Replacing a period in a string

2010-12-02 Thread David Winsemius
On Dec 2, 2010, at 10:46 PM, Luis Felipe Parra wrote: Hello I have a sting of the form 12.084.547,17 which I would like R to understand as a number which has , as the decimal separator, does anybody know how to do this? If that is in a file then read.csv2 is the answer. If it is in a

Re: [R] using ``-'' in function argument

2010-12-02 Thread David Winsemius
On Dec 2, 2010, at 10:47 PM, Erik Iverson wrote: On 12/02/2010 09:35 PM, Jinsong Zhao wrote: Hi there, In function, it's usually using ``='' to assign default value for function argument. For newbie, it's possible to using ``- '' to assign value for function argument. Although it's not a

Re: [R] Replacing a period in a string

2010-12-02 Thread Earl F Glynn
What about this? Remove the periods and change the , to a .: s - 12.084.547,17 x - as.numeric(gsub(',','\\.', gsub('\\.','',s))) options(digits=10) x Escaping periods is not-so-obvious. efg Earl F Glynn Overland Park, KS Luis Felipe Parra wrote: Hello I have a sting of the form

[R] Error using Rcpp under windows xp

2010-12-02 Thread randomcz
Hi, I am a newbie to Rcpp packages, and got problems in having basic set-ups for Rcpp under windows xp. Here is the list I have done. 1) installed Rtools and have no problem in compiling .c file. 2) installed Rcpp packages 3) set enviroment variables 'path' to make C:\Program

Re: [R] using ``-'' in function argument

2010-12-02 Thread Berwin A Turlach
On Thu, 2 Dec 2010 23:34:02 -0500 David Winsemius dwinsem...@comcast.net wrote: [...] Erik is telling you that your use of ncol-4 got evaluated to 4 and that the name of the resulting object was ignored, howevert the value of the operation was passed on to matrix which used positional

Re: [R] Error using Rcpp under windows xp

2010-12-02 Thread Romain Francois
Hello randomcz, Thank you for your interrest in Rcpp. Rcpp has its own mailing list. http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel Please subscribe and report your question there. People will be happy to help you. Romain Le 03/12/10 03:57, randomcz a écrit : Hi, I

Re: [R] Strange problems with compiling dll

2010-12-02 Thread Romain Francois
Hello, Your question is more appropriate on the R-devel mailing list. Le 03/12/10 00:41, Oleksandr Dyklevych a écrit : Dear sir\madam! I'm trying to speed up my R code by writing quite simple dll's in C. But I faced some problems, and I cannot determine their source. #include Rinternals.h

[R] colname refered by a variable

2010-12-02 Thread Yuan Jian
Hello,   I tried to use a variable to refer colname, but I got error, could anyone give me advice?   df=data.frame(cbind(AB=1:3,AC=3:5)) df$AC [1] 3 4 5 df$paste(A,C,sep=) Error: attempt to apply non-function thanks Jian   [[alternative HTML version deleted]]

Re: [R] colname refered by a variable

2010-12-02 Thread Santosh Srinivas
try this .. df[,colnames(df)==paste(A,C,sep=)] On Fri, Dec 3, 2010 at 12:05 PM, Yuan Jian jayuan2...@yahoo.com wrote: Hello, I tried to use a variable to refer colname, but I got error, could anyone give me advice? df=data.frame(cbind(AB=1:3,AC=3:5)) df$AC [1] 3 4 5 df$paste(A,C,sep=)

Re: [R] initial values for alpha and beta in Gamma inverse

2010-12-02 Thread Prof Brian Ripley
See the 'start' argument to glm(). (You have not told us what most of the words in your subject line mean, and I've guessed that c(alpha, beta) are the coefficients in the linear predictor.) On Thu, 2 Dec 2010, Rosario Garcia Gil wrote: Hello I am trying to fit a model using glm function

<    1   2