Re: [R] Data import export zipped files from URLs

2010-01-23 Thread Velappan Periasamy
cannot open: HTTP status was '404 Not Found' while running the following commands f - tempfile() download.file(http://nseindia.com/content/equities/scripvol/datafiles/01-01-2010-TO-23-01-2010RCOMXN.csv;, f) myData - read.csv(f) On 1/19/10, Henrique Dallazuanna www...@gmail.com wrote: Try

Re: [R] Quartiles and Inter-Quartile Range

2010-01-23 Thread Girish A.R.
Interestingly, Hmisc::describe() and summary() seem to be using one Type, and stats::fivenum() seems to be using another Type. fivenum(cbiomass) [1] 910.0 1039.0 1088.5 1156.5 1415.0 summary(cbiomass) Min. 1st Qu. MedianMean 3rd Qu.Max. 9101048108811041139

Re: [R] Optimizing C code

2010-01-23 Thread Christophe Genolini
Duncan Murdoch a écrit : On 22/01/2010 12:52 PM, Christophe Genolini wrote: Thanks both of you. Inf - Inf [1] NaN So isn't the line 9 useless ? If either x[i] or y[i] are NA, then dev will be NA and !ISNAN(dev) will detect it... Sothe loop cool be 8.for(i = 0 ; i taille ; i++) {

Re: [R] Quartiles and Inter-Quartile Range

2010-01-23 Thread David Freedman
and SAS give one a choice of 5 option, and i'm fairly sure that it used a different default than does R (although one of the 5 corresponds to the sas default) see pctldef on http://www.technion.ac.il/docs/sas/proc/z0146803.htm my simple brain thinks of thinks of the problem as 'how does one

[R] R and Limesurvey

2010-01-23 Thread Fabrice DELENTE
Hello. I used Limesurvey to get answers to a survey. Now I need to process the data collected. I exported the R syntax file describing the survey structure, the file is a http://fdelente.free.fr/Surveydata_syntax.R It contains lines like

[R] rda.cv cross validation

2010-01-23 Thread Alexandre Serra Barreto
Dear R listmates, I am doing a cross validation with rda.cv to set alpha and delta parameters in a training set counting on 614 instances. The result of the process in R is: rda.cv(fit = z, x = Tt, y = TtL, nfold = 10) $nonzero      delta alpha 0 0.333 0.667 1

[R] rda.cv cross validation

2010-01-23 Thread Alexandre Serra Barreto
Dear R listmates, I am doing a cross validation with rda.cv to set alpha and delta parameters in a training set counting on 614 instances. The result of the process in R is:      delta alpha 0 0.333 0.667 1 1.333 1.667 2 2.333 2.667 3  0   9    9    9

Re: [R] Data import export zipped files from URLs

2010-01-23 Thread Velappan Periasamy
The same link works and dowloads data while copying and pasteing the link in firebox address box. the file is there and the server is active. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] R and Limesurvey

2010-01-23 Thread Peter Dalgaard
Fabrice DELENTE wrote: Hello. I used Limesurvey to get answers to a survey. Now I need to process the data collected. I exported the R syntax file describing the survey structure, the file is a http://fdelente.free.fr/Surveydata_syntax.R It contains lines like

[R] ltext, small lattice question

2010-01-23 Thread Troels Ring
Dear friends - I have a dataset of 40 patients in two groups observed on three occasions. I only want to plot a line for each patient in the two groups. I use the ltext function to put the patient number but fail to make lattice understand the numbers as unique since apparently it starts all

Re: [R] R and Limesurvey

2010-01-23 Thread Fabrice DELENTE
Hmm, does it help if you first set names(attributes(data)$variable.labels) - names(data) Yes, it does, many thanks! I'll take some time later to work out what all these commands mean :^) -- Fabrice DELENTE __ R-help@r-project.org mailing list

Re: [R] Data import export zipped files from URLs

2010-01-23 Thread Henrique Dallazuanna
Your url is wrong. is missing .zip in the end. See the code again. On Sat, Jan 23, 2010 at 6:37 AM, Velappan Periasamy veepsi...@gmail.com wrote:  cannot open: HTTP status was '404 Not Found' while running the following commands f - tempfile()

Re: [R] sorted reshaping?

2010-01-23 Thread ivo welch
thank you, dennis.  your example was much better than my own, too. for everyone else's benefit who will be searching for the answers for this problem on r-help, let me extend this a little.   the problem arises primarily in data sets that are sparse.  in my case, the first (ordered) firm does not

Re: [R] sorted reshaping?

2010-01-23 Thread Gabor Grothendieck
This also works (giving a matrix so use as.data.frame if you want it as a data frame): tapply(dat.long[,3], dat.long[1:2], c) year firm20022003 2004 20052006 0 NA NA 1.000 NA NA 1 0.86456075 -1.06794272

Re: [R] MAC R crashes

2010-01-23 Thread David Winsemius
The typical reason for a crash on startup is a corrupted (or version mismatched) .RData file. http://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html#R_002eapp-GUI-crashes-on-startup_0021 -- David. On Jan 22, 2010, at 6:32 PM, Peter Rossi wrote: Dear R-Help Group: R will not start on my

Re: [R] simulation of binary data

2010-01-23 Thread Juliet Hannah
Check out the help page of the lrm function in the rms library. To show how lrm is used, the examples simulate data for logistic regression. This may give you some ideas. On Wed, Jan 20, 2010 at 10:41 AM, omar kairan omarkaira...@gmail.com wrote: Hi, could someone help me with dilemma on the

Re: [R] Rotating the axis labels in the basic graphic device ?

2010-01-23 Thread Uwe Ligges
On 22.01.2010 21:26, Tal Galili wrote: Hello dear R help group, I learned recently that one can change the rotation of labels in the axis, when using a lattice plot, for example: library(lattice) barchart(yield ~ variety , data = barley, groups = year, ylab = Barley

Re: [R] Rotating the axis labels in the basic graphic device ?

2010-01-23 Thread Tal Galili
Uwe and Marc, You two just made me smile in more then one way - thank you :) Tal Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |

[R] matrix to a C function

2010-01-23 Thread Christophe Genolini
Hi the list, Is there a way to give a matrix to a C function, and then to use it as a matrix ? I write a function to print a matrix, but I use it as a vector : 1. void printMatrix(double *mTraj,int *nbCol, int *nbLigne){ 2. int i=0,j=0; 3. for(i=0 ; i *nbLigne ; i++){ 4. for(j=0

Re: [R] Rotating the axis labels in the basic graphic device ?

2010-01-23 Thread Marc Schwartz
On Jan 23, 2010, at 10:25 AM, Tal Galili wrote: Marc, Following the R FAQ you linked to, I wonder how to ALWAYS have the text and the plot region fit. I know that if the text is too long, one can use the par(mar = c(big.number, 4, 4 ,4)) and get the text to fit. The question is: Is there

Re: [R] About LU decomposition in R

2010-01-23 Thread Walmes Zeviani
Read the Matrix package documentation require(Matrix) help(lu, html=TRUE) Walmes. - ..oooO .. ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in

[R] Error: could not find function

2010-01-23 Thread Remus Suciu
Hi. I'm trying to create an Agresti-Coull confidence interval without using the binom package. Despite many trials, I keep getting the same problem- see below. y=334 n=1160 alpha=.05 b=(y+.5*qnorm(1-alpha/2)**2)/(n+qnorm(1-alpha/2)**2) b [1] 0.288631

Re: [R] Rotating the axis labels in the basic graphic device ?

2010-01-23 Thread Uwe Ligges
On 23.01.2010 17:42, Marc Schwartz wrote: On Jan 23, 2010, at 10:25 AM, Tal Galili wrote: Marc, Following the R FAQ you linked to, I wonder how to ALWAYS have the text and the plot region fit. I know that if the text is too long, one can use the par(mar = c(big.number, 4, 4 ,4)) and get

Re: [R] Rotating the axis labels in the basic graphic device ?

2010-01-23 Thread Tal Galili
Marc, Following the R FAQ you linked to, I wonder how to ALWAYS have the text and the plot region fit. I know that if the text is too long, one can use the par(mar = c(big.number, 4, 4 ,4)) and get the text to fit. The question is: Is there a way to make the plot know what big.number should be so

Re: [R] Rotating the axis labels in the basic graphic device ?

2010-01-23 Thread Marc Schwartz
On Jan 23, 2010, at 9:51 AM, Uwe Ligges wrote: On 22.01.2010 21:26, Tal Galili wrote: Hello dear R help group, I learned recently that one can change the rotation of labels in the axis, when using a lattice plot, for example: library(lattice) barchart(yield ~ variety , data =

Re: [R] Rotating the axis labels in the basic graphic device ?

2010-01-23 Thread Uwe Ligges
On 23.01.2010 16:56, Marc Schwartz wrote: On Jan 23, 2010, at 9:51 AM, Uwe Ligges wrote: On 22.01.2010 21:26, Tal Galili wrote: Hello dear R help group, I learned recently that one can change the rotation of labels in the axis, when using a lattice plot, for example: library(lattice)

Re: [R] Help on tcl/tk package installation

2010-01-23 Thread Uwe Ligges
On 23.01.2010 01:35, 李道丰 wrote: Hi, how to compile with tcl/tk support ? command line options? thank you:) There is a manual called R Installation and Administration you are obviously not aware of (probably because you never read the posting guide of the mailing list). That manual

Re: [R] Error: could not find function

2010-01-23 Thread Uwe Ligges
On 23.01.2010 17:50, Remus Suciu wrote: Hi. I'm trying to create an Agresti-Coull confidence interval without using the binom package. Despite many trials, I keep getting the same problem- see below. y=334 n=1160 alpha=.05 b=(y+.5*qnorm(1-alpha/2)**2)/(n+qnorm(1-alpha/2)**2) b [1] 0.288631

Re: [R] Rotating the axis labels in the basic graphic device ?

2010-01-23 Thread Marc Schwartz
On Jan 23, 2010, at 9:59 AM, Uwe Ligges wrote: On 23.01.2010 16:56, Marc Schwartz wrote: On Jan 23, 2010, at 9:51 AM, Uwe Ligges wrote: On 22.01.2010 21:26, Tal Galili wrote: Hello dear R help group, I learned recently that one can change the rotation of labels in the axis,

Re: [R] lm on group

2010-01-23 Thread Adaikalavan Ramasamy
You can guess by looking at class(g). It is a factor. It is NOT regressing on the mean of g (i.e. 2.5 and 7.5) and you could have changed g from (0,5] and (5,10] to A and B with the same results. Read some books or help(lm) to get an idea of what the outputs mean. Regards, Adai newbieR

[R] fatal error unable to restore saved data in .rdata

2010-01-23 Thread Badaoui, Saad
Dear R help team, I am trying to open R to continue my analysis but it doesn't want to open and I get this message fatal error unable to restore saved data in .rdata. I don't know what went wrong ( iam using Windows). Could you please help me on this? Thanks a lot Best Regards Saad

[R] Failure to produce italics in jpeg

2010-01-23 Thread Dennis Fisher
Colleagues, Using R 2.10.1 in OS X (Snow Leopard), I created JPEG documents that were intended to include italicized text. In the JPEG versions, the italics appear in bold-face. The identical code (except for the call to the device) yields italics in PDF. A minimal example is: PDF

Re: [R] fatal error unable to restore saved data in .rdata

2010-01-23 Thread Duncan Murdoch
On 23/01/2010 10:56 AM, Badaoui, Saad wrote: Dear R help team, I am trying to open R to continue my analysis but it doesn't want to open and I get this message fatal error unable to restore saved data in .rdata. I don't know what went wrong ( iam using Windows). Could you please help me on

Re: [R] first and second derivative calculation

2010-01-23 Thread Adaikalavan Ramasamy
How about? eval( D( expression( t^3-6*t^2+5*t+30 ), t ) ) David Winsemius wrote: On Jan 22, 2010, at 6:49 PM, Marlin Keith Cox wrote: I can plot this just fine: t-seq(0,4, by=.1) y- t^3-6*t^2+5*t+30 plot(t,y ,xlab=t-values, ylab=f(t), type=l) This is the first derivative, how I I make a

Re: [R] fatal error unable to restore saved data in .rdata

2010-01-23 Thread Patrick Burns
And once you've renamed the file and started R, it might be worth a try to see if you can 'attach' the file. On 23/01/2010 17:22, Duncan Murdoch wrote: On 23/01/2010 10:56 AM, Badaoui, Saad wrote: Dear R help team, I am trying to open R to continue my analysis but it doesn't want to open and

Re: [R] matrix to a C function

2010-01-23 Thread Romain Francois
Christophe, That's another question for the R-devel mailing list. A few things however. Short answer : no it is not possible. I don't think x[i,j] is even syntactically valid in C or C++. I'd suggest you to give a go at the .Call interface that lets you manipulate R objects directly. So in

[R] ff package: ff objects don't reload completely on NFS drives from a different machine

2010-01-23 Thread Hao Cen
Hi ff users and Jens, I am using the ff package and it has been working great. Recently I noticed an unexpected behavior in the ff package -- when I save an ff matrix on one machine to an NFS drive and load it on another machine from the save NFS drive, I got quote a lot of zeros in the matrix.

[R] How to apply a function on each column of a matrix

2010-01-23 Thread anna
Hello everyone, I get for each date a measure for n elements in the form of a matrix. I am converting it to a ts object using ts(). I want to apply a function on each column. I started using the apply function ( set to 2) but what it returns is a matrix with the same columns representing the

[R] How to implement a select distinct x, count(distinct y) ... group by x for a data frame

2010-01-23 Thread Dimitri Shvorob
... Being an R newbie, I can only think of extracting distinct x values with unique, looping over them, extracting matching rows from the original data frame, applying table, and recording the size of table's output alongside the x value being checked. Is there a more elegant way? Thank you. --

[R] lattice ltext

2010-01-23 Thread Troels Ring
Dear friends - please give me a hand. I have a dataset of 40 patients in two groups observed on three occasions. I only want to plot a line for each patient in the two groups. I use the ltext function to put the patient number but fail to make lattice understand the numbers as unique since

Re: [R] How to apply a function on each column of a matrix

2010-01-23 Thread anna
Here is the last code that I wrote but it would give me the same problem: I have the matrix mat with n columns mat.1, mat.2 ...mat.n #To be able to use lapply I convert it to a data.frame: mat - data.frame(mat) lapply(mat, function, argument of function) It works but I still get for all

Re: [R] Rotating the axis labels in the basic graphic device ?

2010-01-23 Thread Jim Lemon
On 01/24/2010 03:25 AM, Tal Galili wrote: Marc, Following the R FAQ you linked to, I wonder how to ALWAYS have the text and the plot region fit. I know that if the text is too long, one can use the par(mar = c(big.number, 4, 4 ,4)) and get the text to fit. The question is: Is there a way to make

Re: [R] How to implement a select distinct x, count(distinct y) ... group by x for a data frame

2010-01-23 Thread jim holtman
Yes. ?sqldf ?split ?lapply But unless you provide commented, minimal, self-contained, reproducible code, it is hard to say how to proceed to a solution. On Sat, Jan 23, 2010 at 5:46 PM, Dimitri Shvorob dimitri.shvo...@gmail.com wrote: ... Being an R newbie, I can only think of extracting

Re: [R] How to apply a function on each column of a matrix

2010-01-23 Thread Jim Lemon
On 01/24/2010 11:11 AM, anna wrote: Here is the last code that I wrote but it would give me the same problem: I have the matrix mat with n columns mat.1, mat.2 ...mat.n #To be able to use lapply I convert it to a data.frame: mat- data.frame(mat) lapply(mat, function, argument of function) It

Re: [R] ff package: ff objects don't reload completely on NFS drives from a different machine

2010-01-23 Thread Henrik Bengtsson
Hi, this could be due to how NFS works. Note that there can be up to a 30 second delay before other hosts on the same file system see the updates that was flushed by one machine. You basically cannot treat files on an shared NFS file system as if you are working on a single machine. You have

Re: [R] How to implement a select distinct x, count(distinct y) ... group by x for a data frame

2010-01-23 Thread Gabor Grothendieck
Regarding your subject, the sqldf package on CRAN allows you to apply SQL statements directly to R data frames. http://sqldf.googlecode.com On Sat, Jan 23, 2010 at 5:46 PM, Dimitri Shvorob dimitri.shvo...@gmail.com wrote: ... Being an R newbie, I can only think of extracting distinct x values

Re: [R] Data import export zipped files from URLs

2010-01-23 Thread Velappan Periasamy
http://nseindia.com/content/equities/scripvol/datafiles/01-01-2010-TO-23-01-2010RCOMXN.csv the url is correct. it is not zipped file. copy the url in the browser window you will get the this .. Symbol,Series,Date, Prev Close,Open Price,High Price,Low Price,Last Price,Close Price,Average

Re: [R] How to apply a function on each column of a matrix

2010-01-23 Thread Ted Harding
On 24-Jan-10 00:27:37, Jim Lemon wrote: On 01/24/2010 11:11 AM, anna wrote: Here is the last code that I wrote but it would give me the same problem: I have the matrix mat with n columns mat.1, mat.2 ...mat.n #To be able to use lapply I convert it to a data.frame: mat- data.frame(mat)

[R] End of File for binary files

2010-01-23 Thread rn00b
Hello, I'm new to R and I'm writing a function to read binary tables (the binary version of read.table essentially). I'm having trouble figuring out how to determine when I reach end-of-file. Can anybody please help? thanks! -- View this message in context:

Re: [R] End of File for binary files

2010-01-23 Thread jim holtman
If you are reading a 'binary' file, then the end of file is when you read the last byte; the system will tell you. Exactly what are you trying do to? When you do a read, you typically request the number of bytes to read and then the system returns the number of bytes read. But since you did not

[R] header files for R packages

2010-01-23 Thread David Lubbers
I have 6 or 7 nice constants (for example 1852 meters per nautical mile) I would like to have available to 4 or 5 functions in an R package. In C this would just be a header .h file and I would just include I am stuck trying to figure out how to create something like a C header file for an R

Re: [R] End of File for binary files

2010-01-23 Thread rn00b
I am using readBin to continuously read characters from the binary file. I'm trying to figure out how many characters are in the file. What I would like to do is something like (while! EOF) { charRead -.Internal(readBin(con,character,1L,NA,TRUE,swap)) i++ } I'm not clear on how to determine the

Re: [R] End of File for binary files

2010-01-23 Thread jim holtman
Are you really trying to read in binary? You are asking for characters which would be a null terminated string. If you are trying to read in binary zeroes, this will not work. What you need to do is to use 'raw'. Actually you should create a R script to test out the various conditions you

[R] Feature selection

2010-01-23 Thread Amy Hessen
Hi, Could you please tell me whether there are feature selection algorithms in R or not such as genetic algorithms? If so, could you please tell me in which package? Cheers, Amy _ View

[R] tree()...binary reponse giving only one split

2010-01-23 Thread Seth
Hi, I'm new to CART. I have a data set with a binary reponse (0/1) and several predictors. I chose 2 continuous predictors to start and used the following code. testdata.ltr-tree(nondev85dev06~dist_rampm_wa + dis_prim_wa,testdata) The two predictors should be quite explanatory based upon