Re: [R] R graphs differ from exported one

2011-06-13 Thread Mark Seeto
I didn't include code because I wasn't asking for help; I was merely commenting that I had seen the same thing happen. But thank you for mentioning dev.off, which I had not heard of before. On Mon, Jun 13, 2011 at 3:55 PM, Prof Brian Ripley rip...@stats.ox.ac.uk wrote: Usually this happens when

Re: [R] running R commands asynchronously

2011-06-13 Thread Norm Matloff
On 06/10/2011 02:29 PM, Richard M. Heiberger wrote: I am interested in running R commands asynchronously... You can do this with my Rdsm package on CRAN. Set up 2 Rdsm clients, which I'll call A and B. Use client A as you main R session, where you do most of your work, but start your

[R] documentation in R

2011-06-13 Thread siddharth arun
How we can call auto.arima in R. Is there any cran package we need to install for this function? -- Siddharth Arun, 4th Year Undergraduate student Industrial Engineering and Management, IIT Kharagpur [[alternative HTML version deleted]] __

Re: [R] documentation in R

2011-06-13 Thread nuncio m
Dear Arun, Prof. Rob Hyndman's forecast package has automated arima. You have to install 'forecast' library for that. in linux go to r-prompt and type install.packages(). Hope this helps nuncio On Mon, Jun 13, 2011 at 12:10 PM, siddharth arun sid.aru...@gmail.comwrote: How we

Re: [R] automatically generate the output name of my for loops

2011-06-13 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 13.06.2011 05:21:23: Re: [R] automatically generate the output name of my for loops ?paste something like... paste (group, i, sep=_) I believe that better idea is to use list, with which you can work further much more efficiently. lll-

[R] Odp: How do I make proper use of the by() function?

2011-06-13 Thread Petr PIKAL
Hi [R] How do I make proper use of the by() function? Dear list, I have a function that uses values from two vectors and spits out one new vector based on all the values of the two original vectors, and with the same length as them. Ok, I would now like to be able to apply that

Re: [R] computer name

2011-06-13 Thread Erich Neuwirth
This depends on your OS. on Windows, Sys.getenv('computername') should work. Sys.info()['nodename'] should work on all systems. On 6/13/2011 7:38 AM, David Scott wrote: On 13/06/11 15:19, pdb wrote: Is there an r function that will be able to identify the computer the code is running on?

Re: [R] smoothScatter function (color density question) and adding a legend

2011-06-13 Thread Mike Marchywka
Date: Sat, 11 Jun 2011 21:52:21 -0400 From: ccoll...@purdue.edu To: r-help@r-project.org Subject: [R] smoothScatter function (color density question) and adding a legend Dear R experts, I am resending my questions below one more time

[R] How to formulate an (effect-modifying) interaction with matching variable in a conditional logistic regression?

2011-06-13 Thread Fredrik Nilsson
Hi, I would like to see if a matching variable is an effect-modifier in a conditional logistic regression. Naturally, the matching variable can't enter directly in the model but as an interaction with terms that are in. However, I have problems in formulating the correct model the term that's

Re: [R] Somers Dyx

2011-06-13 Thread Frank Harrell
Tyler, The rcorr.cens, rcorrp.cens, and somers2 functions compute Dxy. That is a typo in the overview, which we'll fix. Dxy is the appropriate measure for binary Y, I think. It is a simple translation of the ROC area and does not penalize for ties on Y. Frank Tyler Rinker wrote: Hello R

[R] In rpart, how is improve calculated? (in the class case)

2011-06-13 Thread Tal Galili
Hi all, I apologies in advance if I am missing something very simple here, but since I failed at resolving this myself, I'm sending this question to the list. I would appreciate any help in understanding how the rpart function is (exactly) computing the improve (which is given in fit$split), and

[R] How to create a numeric data.frame

2011-06-13 Thread Aparna
Hi All I am new to R and I am not sure of how this should be done. I have a matrix of 985x100 values and the class is data.frame. A sample of my dataset looks like this (Since its a huge dataset and it would make the screen look more complex, I am pasting only the first few rows and

Re: [R] Extracting SNP data from database

2011-06-13 Thread Jim Silverton
Hi, I am interested in getting some SNP data. I need a small dataset but it is the extraction of the SNPs in the form of numeric tables that is giving the problems. I would like to extract SNP data for some type of bacteria (haploid). -- Thanks, Jim. [[alternative HTML version deleted]]

[R] Help: which R packages are for time series data mining

2011-06-13 Thread Yanchang Zhao
Hi Are there any R packages or functions available for data mining of time series data? By mining, I mean representation, similarity metrics, change points detection, classification and clustering of time series data. Thanks Yanchang -- Yanchang Zhao PhD, Data Miner Email:

Re: [R] How to create a numeric data.frame

2011-06-13 Thread Sarah Goslee
What are you trying to do? It looks numeric, although a visual assessment isn't reliable. The output of str() would be helpful. But I'm not sure what your objective is. What do you think your data frame is now, and what do you think it should be? Sarah On Mon, Jun 13, 2011 at 6:06 AM, Aparna

[R] How to calculate the product of every two elements in two lists?

2011-06-13 Thread carla moreira
u-c(0.1,0.2,0.3) v-c(0.2,0.3,0.5) outer1-outer(u,u,=) outer2-outer(v,v,=) m-nrow(outer1) j-nrow(outer2) zz-lapply(1:m, function(m) as.numeric(outer1[m,])) tt-lapply(1:m, function(m) as.numeric(outer2[m,])) zz[[1]]*tt[[3]], e.g., is possible, but I want every products between two lists. Is

[R] cause 'memory not mapped'

2011-06-13 Thread ascendo
Dear R-help Hi, I'm Won. I try to do microarray normalization by R. I use justRMA function within affy package, got error about segment fault. I don't know why it happen. I attached error below. Please help me. Thank you. Cheers, Won === OS : Redhat linux Cpu : intel

Re: [R] Help: which R packages are for time series data mining

2011-06-13 Thread Sarah Goslee
Here would be a really good place to start: http://cran.r-project.org/web/views/TimeSeries.html On Mon, Jun 13, 2011 at 7:45 AM, Yanchang Zhao yanchangz...@gmail.com wrote: Hi Are there any R packages or functions available for data mining of time series data? By mining, I mean

Re: [R] How to create a numeric data.frame

2011-06-13 Thread Joshua Wiley
Hi, If your matrix is already numeric, then: as.data.frame(your_matrix_name) will do the trick. However, if you have a matrix that is not numeric (say it is character), then you could use: as.data.frame(as.numeric(your_matrix_name)) Matrices can only hold one class of data (for example, all

Re: [R] How to calculate the product of every two elements in two lists?

2011-06-13 Thread Joshua Wiley
Hi, Do you mean something like this? mapply(`*`, zz, tt) [,1] [,2] [,3] [1,]111 [2,]011 [3,]001 or do you want each element of zz by each element of tt (i.e., every possible 2-way combination)? Cheers, Josh On Mon, Jun 13, 2011 at 6:23 AM, carla

Re: [R] cause 'memory not mapped'

2011-06-13 Thread Jeff Newmiller
You need to ask this question on the Bioconductor mailing list. --- Jeff Newmiller The . . Go Live... DCN:jdnew...@dcn.davis.ca.us Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer

Re: [R] How to calculate the product of every two elements in two lists?

2011-06-13 Thread Joshua Wiley
Okay, what about this: ## use expand.grid() to create a data frame of all combinations ## of the element numbers of zz and tt index - expand.grid(seq_along(zz), seq_along(tt)) index ## use the index to select the element of zz and tt and find their product mapply(`*`, zz[index[, 1]], tt[index[,

Re: [R] How to create a numeric data.frame

2011-06-13 Thread Barry Rowlingson
On Mon, Jun 13, 2011 at 11:06 AM, Aparna aparna.sampat...@gmail.com wrote: Hi All I am new to R and  I am not sure of how this should be done. I have a matrix of 985x100 values and the class is data.frame. You don't have a 'matrix' in the R sense of the word. You seem to have a table of

Re: [R] How to create a numeric data.frame

2011-06-13 Thread Joshua Wiley
On Mon, Jun 13, 2011 at 7:45 AM, Barry Rowlingson b.rowling...@lancaster.ac.uk wrote: [snip]  now you may think it reasonable to do an 'as.numeric' on that, but what about:  as.numeric(list(foo=list(bar=c(1,2,3),baz=c(34,5)),bar=c(Hello,World))  how would you 'as.numeric' that? Well, Hello

Re: [R] How to create a numeric data.frame

2011-06-13 Thread Patrizio Frederic
On Mon, Jun 13, 2011 at 4:45 PM, Barry Rowlingson b.rowling...@lancaster.ac.uk wrote: On Mon, Jun 13, 2011 at 11:06 AM, Aparna aparna.sampat...@gmail.com wrote: Hi All I am new to R and  I am not sure of how this should be done. I have a matrix of 985x100 values and the class is data.frame.

Re: [R] automatically generate the output name of my for loops

2011-06-13 Thread jiliguala
really thanks for helping. i just did just like what Petr Pikal said, but it appeared some error like this: There were 50 or more warnings (use warnings() to see the first 50): Warning messages: 1: In group[i] - which(k1$cluster == i) : number of items to replace is not a multiple of

Re: [R] How to create a numeric data.frame

2011-06-13 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 13.06.2011 17:19:39: Patrizio Frederic frederic.patri...@gmail.com On Mon, Jun 13, 2011 at 4:45 PM, Barry Rowlingson b.rowling...@lancaster.ac.uk wrote: On Mon, Jun 13, 2011 at 11:06 AM, Aparna aparna.sampat...@gmail.com wrote: Hi All I am

Re: [R] automatically generate the output name of my for loops

2011-06-13 Thread jim holtman
I think you need '[[' group[[i]] - which(k1$cluster == i) On Mon, Jun 13, 2011 at 11:35 AM, jiliguala jiligu...@mail.com wrote: really thanks for helping. i just did just like what Petr Pikal said, but it appeared some error like this: There were 50 or more warnings (use warnings() to see

Re: [R] automatically generate the output name of my for loops

2011-06-13 Thread Vijayanpadmanabhan
Hi Daniel Try using this approach ##Drawing analogy from your example.. I am storing the values generated in a loop in the following code for (i in c(1:100)) { nam - paste(r,i, sep=.) assign(nam, i+1) } ##Having stored the values generated in the above loop in as many R objects..Here

Re: [R] using categorical variable in multiple regression

2011-06-13 Thread Vijayanpadmanabhan
Try using RandomForest.. -- View this message in context: http://r.789695.n4.nabble.com/using-categorical-variable-in-multiple-regression-tp3591517p3594170.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

[R] log2() and -min() very quick question

2011-06-13 Thread Ben Ganzfried
I'm looking over good-code a post-doc in my lab wrote and trying to learn how it works. I came across the following: rel.abundance - as.matrix(read.delim(rel.abundance.csv,row.names=1,as.is =TRUE)) rel.abundance - log2(rel.abundance-min(rel.abundance)+1) I'm not sure what the second line is

Re: [R] automatically generate the output name of my for loops

2011-06-13 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 13.06.2011 17:35:29: jiliguala jiligu...@mail.com really thanks for helping. i just did just like what Petr Pikal said, but it appeared some error like this: There were 50 or more warnings (use warnings() to see the first 50): Warning

Re: [R] log2() and -min() very quick question

2011-06-13 Thread jim holtman
The second line is just scaling the data based on log2. It is subtracting the minimun of the entire matrix (not just each row) and adding 1 to make sure there is not a value of zero since log2(0) is not valid. Here is an example of sample data: x - matrix(runif(25, -50, 50), 5) x

[R] Odp: log2() and -min() very quick question

2011-06-13 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 13.06.2011 17:59:03: Ben Ganzfried ben.ganzfr...@gmail.com Odeslal: r-help-boun...@r-project.org 13.06.2011 17:59 Komu r-help@r-project.org Kopie Předmět [R] log2() and -min() very quick question I'm looking over good-code a

Re: [R] cause 'memory not mapped'

2011-06-13 Thread Martin Morgan
On 06/13/2011 06:23 AM, ascendo wrote: Dear R-help Hi, I'm Won. I try to do microarray normalization by R. I use justRMA function within affy package, got error about segment fault. I don't know why it happen. I attached error below. Hi Won -- as suggested, post to the Bioconductor

Re: [R] automatically generate the output name of my for loops

2011-06-13 Thread jiliguala
hi, really thank u, Petr Pikal problem solved already. but here is another question: for(i in 1:100) data1[[i]] - rbind(data2[1,], data3[i,]) the codes above are no problem, but now i wnna do two loops like the codes below which have problem(the bold letters): i dont know what should be put

Re: [R] How to create a numeric data.frame

2011-06-13 Thread Patrizio Frederic
Which results in vector of numbers str(as.numeric(as.matrix(a)))  num [1:100] 0.82 -1.339 1.397 0.673 -0.461 ... data frame is convenient list structure which can contain vectors of various nature (numeric, character, factor, logical, ...) and looks quite similar to Excel table. matrix

Re: [R] automatically generate the output name of my for loops

2011-06-13 Thread jim holtman
If you want to have multidimensioned list, here is one way of doing it by making sure you initialize the second level before using it: data2 - matrix(1:30, nrow = 10) data3 - matrix(1:300, nrow = 100) data1 - list() # init to a list for (j in 1:10){ data1[[j]] - list() #create second

Re: [R] automatically generate the output name of my for loops

2011-06-13 Thread jiliguala
hi, jholtman its true, the problem was to iniciate the list at the second level. thx a lot -- View this message in context: http://r.789695.n4.nabble.com/automatically-generate-the-output-name-of-my-for-loops-tp3592160p3594397.html Sent from the R help mailing list archive at Nabble.com.

[R] SAS Mixed

2011-06-13 Thread justin bem
I have drink the cup down to the last drop in a course on linear models with SAS. I didn't learn a lot about statistic the 95 percent of the course consist of stupid SAS outputs, with a teacher who is a SAS Guru. Is there and equivalent of repetead option for mixed in R (I hope No for me

Re: [R] Trying to make code more efficient

2011-06-13 Thread Brian Diggs
On 6/9/2011 12:27 PM, Abraham Mathew wrote: I have a repetative task in R and i'm trying to find a more efficient way to perform the following task. lst- list(roots = c(car insurance, auto insurance), roots2 = c(insurance), prefix = c(cheap, budget), prefix2 = c(low

Re: [R] SAS Mixed

2011-06-13 Thread Ben Bolker
justin bem justin_bem at yahoo.fr writes: I have drink the cup down to the last drop in a course on linear models with SAS. I didn't learn a lot about statistic the 95 percent of the course consist of stupid SAS outputs, with a teacher who is a SAS Guru. Is there and equivalent of

[R] persp and trans3d for type=h points

2011-06-13 Thread Tarmo Remmel
Hello, I have a matrix [9,11] called tempmed from which I produce a perspective plot. I then indicate a point on the surface to which I want to drop a point using points() and trans3d(). The code is below. However, the dropped line does not draw properly on the plot, it only comes down about

[R] remove commas in a number when reading a text file

2011-06-13 Thread Lee, Eric
Hello, I'm running version R x64 v2.12.2 on a 64bit windows 7 PC. I'm trying to read a text file using read.table where the values have a format like 1,234,567. What I want is 1234567. Is there a quick way to strip out the commas? I can use strsplit and paste, but the file is quite large

[R] Strange R/party behaviuor in CentOS

2011-06-13 Thread jdanielnd
Hello, I'm facing a strange behaviour when I try to run predict function for a cforest model from party package in CentOS. It works OK on MacOSX and Ubuntu, but R process is killed when I try it on CentOS. I read a dataframe and generate a forest model using cforest from party package. To reduce

[R] garch() false convergence

2011-06-13 Thread user84
Hi, i did in the last month a research about timeseries with the function ARIMA(). Where i had to know how to predict and forecast new datapoints in the future. Not only the things the functions predict() and forecast() can do. All was ok, as the arima function was in the major parts convergent

[R] Heatmap in R and/or ggplot2

2011-06-13 Thread idris
I have a dataframe df with columns x, y, and height. I want to create a heatmap-like plot that creates a grid of x by y, and then color codes the grid depending on the value of height. Is there a ggplot2 object to do this? I'm able to easily do this in Excel with pivot tables and conditional

Re: [R] Question about license for redistribution of R package

2011-06-13 Thread Iyer
Hello, I would like to distribute an R package along with an application. The package is written exclusively in R. Since the package does not make sense outside of the application it does not make sense to submit it to CRAN. I have a question regarding licensing if I manage the

[R] Setting up counting process data for survival analysis

2011-06-13 Thread Paul Miller
Hello Everyone, I'm learning to do survival analysis in R using a time-varying covariate. I've managed to set up my data correctly using SAS and then to get the correct result using R. What I'd like help with is getting the data set up correctly in R without having to resort to using SAS.

[R] Logistic regression with 2 factors and 3 covariates

2011-06-13 Thread Alal
Hello I'm trying to write a model for my data, but Im not sure it's statistically correct. I have one variable (2 levels: A or B). To explain it, I've got 2 factors and 3 continuous variables. I need to do a logistic regression, but... First: can I actually do a logistic regression with all of

[R] maintaining row connections during aggregate

2011-06-13 Thread Kara Przeczek
Dear All, I have several sets of data such as this: year jday avg_m3s 1 19601 4.262307 2 19602 4.242308 3 19603 4.216923 4 19604 4.185385 5 19605 4.151538 6 19606 4.133846 ... There is a value for each day of multiple years. In this particular data set it goes up to

[R] Convert SAS code to R code about survival analysis

2011-06-13 Thread karena
Hi, I am working on transforming a SAS code to R code. It's about the survival analysis and the SAS code is as below: -- proc lifetest data=surdata plot=(s); time surv*censht(1); strata educ; title 'Day 1 homework'; run;

Re: [R] How to calculate the product of every two elements in two lists?

2011-06-13 Thread carla moreira
Thank you very much. I want each element of zz by each element of tt (i.e., every possible 2-way combination). -- View this message in context: http://r.789695.n4.nabble.com/How-to-calculate-the-product-of-every-two-elements-in-two-lists-tp3593832p3593941.html Sent from the R help mailing

Re: [R] How to create a numeric data.frame

2011-06-13 Thread Aparna
Hi Joshua While looking at the data, all the values seem to be in numeric. As i mentioned, the dataset is already in data.frame. As suggested, I used str(mydata) and got the following result: str(leu_cluster1) 'data.frame': 984 obs. of 100 variables: $ V2 : Factor w/ 986 levels

Re: [R] remove commas in a number when reading a text file

2011-06-13 Thread Joshua Wiley
Hi Eric, Try this: gsub(,, , 1,234,567, fixed = TRUE) Cheers, Josh On Mon, Jun 13, 2011 at 8:48 AM, Lee, Eric e...@air-worldwide.com wrote: Hello, I'm running version R x64 v2.12.2 on a 64bit windows 7 PC.  I'm trying to read a text file using read.table where the values have a format

[R] use variable value to create new variable name

2011-06-13 Thread maciek kryza
Hi, Is it possible (and how) to use a variable value to create a name of a new R variable? I want to do something like this: for (i in 1:3) { newvarialbe_#i# = somedata } where #i# is a value stored by i. In the first loop, there will be newvariable_1, in second newvariable_2 and so on. Thanks

Re: [R] How to create a numeric data.frame

2011-06-13 Thread Aparna
Hi Sarah Thanks for your advice. My dataset contains all the normalized values. I have to give this dataset as input to ClusterCons package in R. In order to run the package, it requires the data to be converted to numeric data.frame. When i check my data using class(mydataset), it is in the

Re: [R] remove commas in a number when reading a text file

2011-06-13 Thread Peter Alspach
Tena koe Eric ?sub and ?gsub HTH ... Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Lee, Eric Sent: Tuesday, 14 June 2011 3:49 a.m. To: r-help@R-project.org Subject: [R] remove commas in a number when

[R] using Scheirer-Ray-Hare in R?

2011-06-13 Thread jcallaway
Does anyone know if a module already exists to run the Scheirer-Ray-Hare extension to Kruskal-Wallis in R, in order to run a non-parametric equivalent to a two-way ANOVA? -- View this message in context: http://r.789695.n4.nabble.com/using-Scheirer-Ray-Hare-in-R-tp3594480p3594480.html Sent from

[R] plotting on an image

2011-06-13 Thread Johann Kim
Hello all, has someone please a few hints about how to 1.st: draw an image (preferrably a jpg) and then 2nd: plot() on that image I am using a mac - and after searching and trying different ways (I have installed EBImage) I now would like to ask for help... Thanks! Johann

Re: [R] remove commas in a number when reading a text file

2011-06-13 Thread Peter Langfelder
On Mon, Jun 13, 2011 at 8:48 AM, Lee, Eric e...@air-worldwide.com wrote: Hello, I'm running version R x64 v2.12.2 on a 64bit windows 7 PC.  I'm trying to read a text file using read.table where the values have a format like 1,234,567.  What I want is 1234567.  Is there a quick way to strip

Re: [R] use variable value to create new variable name

2011-06-13 Thread Peter Alspach
Tena koe Maciek It is possible; e.g.: i - 3 assign(paste('myVar', i, sep=''), 1:5) myVar3 [1] 1 2 3 4 5 Personally, I find it is more convenient to use a list so that instead of myVar1, myVar2 etc I have a list object, myVar, with each element equivalent to myVar1, myVar2 etc. HTH ... Peter

Re: [R] How to create a numeric data.frame

2011-06-13 Thread Patrizio Frederic
On Mon, Jun 13, 2011 at 6:47 PM, Aparna aparna.sampat...@gmail.com wrote: Hi Joshua While looking at the data, all the values seem to be in numeric. As i mentioned, the dataset is already in data.frame. As suggested, I used str(mydata) and got the following result: str(leu_cluster1)

Re: [R] How to create a numeric data.frame

2011-06-13 Thread Joshua Wiley
On Mon, Jun 13, 2011 at 2:11 PM, Patrizio Frederic frederic.patri...@gmail.com wrote: On Mon, Jun 13, 2011 at 6:47 PM, Aparna aparna.sampat...@gmail.com wrote: Hi Joshua While looking at the data, all the values seem to be in numeric. As i mentioned, the dataset is already in data.frame.

Re: [R] use variable value to create new variable name

2011-06-13 Thread jdanielnd
Actually it's highly discouraged to do that, since you lose control of the number of variables do you have, you spread them in different objects. It's much wiser to use a vector or a list to do that. -- View this message in context:

Re: [R] Heatmap in R and/or ggplot2

2011-06-13 Thread baptiste auguie
Hi, Try this ggplot(df, aes(x,y)) + geom_tile(aes(fill=height), colour=white) + scale_fill_gradientn(colours = c(red, gold, green)) + geom_text(aes(lab=height)) HTH, baptiste On 14 June 2011 07:12, idris idris.r...@gmail.com wrote: I have a dataframe df with columns x, y, and height. I want

[R] glm with binomial errors - problem with overdispersion

2011-06-13 Thread Anna Mill
Dear all, I am new to R and my question may be trivial to you... I am doing a GLM with binomial errors to compare proportions of species in different categories of seed sizes (4 categories) between 2 sites. In the model summary the residual deviance is much higher than the degree of freedom

[R] combine the data frames into comma separated list.

2011-06-13 Thread Mary Kindall
Hi R users, I am new to R and am trying to merge data frames in the following way. Suppose I have n data frames each with two fields. Field 1 is common among data frames but may have different entries. Field 2 is different. Data frame 1: Src Target1 1aaa 1bbb 1ccc 2

[R] Composing two n-dimensional arrays into one n+1-dimensional array

2011-06-13 Thread Stavros Macrakis
If I have 2 n-dimensional arrays, how do I compose them into a n+1-dimension array? Is there a standard R function that's something like the following, but that gives clean errors, handles all the edge cases, etc. abind - function(a,b) structure( c(a,b), dim = c(dim(a), 2) ) m1 -

[R] combine the data frames into comma separated list.

2011-06-13 Thread Mary Kindall
Hi R users, I am new to R and am trying to merge data frames in the following way. Suppose I have n data frames each with two fields. Field 1 is common among data frames but may have different entries. Field 2 is different. Data frame 1: Src Target1 1aaa 1bbb 1ccc 2

Re: [R] How to create a numeric data.frame

2011-06-13 Thread Richard M. Heiberger
Aparna, Something is very strange here. I think it is time to go back to the original data source and find out why the file you thought contained numbers was read as factors. Is there an unanticipated comma in a field? Did you forget to say header=TRUE? Rich On Mon, Jun 13, 2011 at 5:30 PM,

Re: [R] Composing two n-dimensional arrays into one n+1-dimensional array

2011-06-13 Thread Bert Gunter
Strangely enough, abind() in the abind package !! -- Bert (all edge cases is too vague to guess whether abind meets your criteria) On Mon, Jun 13, 2011 at 2:34 PM, Stavros Macrakis macra...@alum.mit.edu wrote: If I have 2 n-dimensional arrays, how do I compose them into a n+1-dimension array?

Re: [R] combine the data frames into comma separated list.

2011-06-13 Thread Dr. D. P. Kreil (Boku)
Hi, try ?merge Best, David. On 13 June 2011 23:48, Mary Kindall mary.kind...@gmail.com wrote: Hi R users, I am new to R and am trying to merge data frames in the following way. Suppose I have n data frames each with two fields. Field 1 is common among data frames but may have different

[R] Hadoop Hive output read into R

2011-06-13 Thread Josh Lemaitre
All, I am using a pretty crude method to get data out of HDFS via Hive and into R and was curious about alternatives that the group has explored. Basically, I run a system command that runs a hive statement and writes the returned data to a delimited file. Then, I read that file into an object

Re: [R] maintaining row connections during aggregate

2011-06-13 Thread Dennis Murphy
Hi: Here are two ways to do it - one with ddply() in the plyr package and another with package data.table. # Toy data frame: tsdf - data.frame(year = rep(c(1960:1963), c(366, rep(365, 3))), jday = c(1:366, rep(1:365, 3)), y = rnorm(4*365 + 1)) # A function

Re: [R] How to calculate the product of every two elements in two lists?

2011-06-13 Thread Dennis Murphy
Hi: Here's a slightly different approach: # Create two numeric matrices with outer(): o1 - outer(u,u,=) * 1L o2 - outer(v, v, =) * 1L # Make a list of matrices that multiplies column i of o1 # vs. each column of o2 - use the * operator to do this # Shows what is going on at each step:

Re: [R] combine the data frames into comma separated list.

2011-06-13 Thread Mary Kindall
Thanks for reply. The following code is working but only patially. How to get the condensed values separated by comma. dataframe1 = data.frame(cbind(Src = c(1,1,1,2,3), Target1 = c('aaa','bbb','ccc','aaa','ddd'))); dataframe2 = data.frame(cbind(Src = c(2,3,4,4,4), Target2 =

Re: [R] combine the data frames into comma separated list.

2011-06-13 Thread Dr. D. P. Kreil (Boku)
?write.csv Cheers, David. On 14 June 2011 01:07, Mary Kindall mary.kind...@gmail.com wrote: Thanks for reply. The following code is working but only patially. How to get the condensed values separated by comma. dataframe1 = data.frame(cbind(Src = c(1,1,1,2,3), Target1 =

[R] Count objects and print it into a new variable

2011-06-13 Thread saba
Hello, I used R a year ago. With the data I am working with now, I realized that I need to go back to R. Unfortunately, my memory is not my friend if it comes down to coding :-) What I want to do is extract the length of a variable of a file with certain conditions and then print this number in

Re: [R] remove commas in a number when reading a text file

2011-06-13 Thread Lee, Eric
Thanks, Peter and to Joshua Wiley and Peter Alspach for similar comments. Gsub did the trick. -Original Message- From: Peter Langfelder [mailto:peter.langfel...@gmail.com] Sent: Monday, June 13, 2011 4:35 PM To: Lee, Eric Cc: r-help@R-project.org Subject: Re: [R] remove commas in a

Re: [R] combine the data frames into comma separated list.

2011-06-13 Thread Mary Kindall
How?? I dont think there is any parameter that does this job. I came up with ddply function in plyr package but having tens of dataframe and doing it in a for loop may not be a good idea. ddply(test, ~ Src , colwise(paste, .(Target1)), collapse =, ); Can you please write how it can be done by

Re: [R] combine the data frames into comma separated list.

2011-06-13 Thread Dr. D. P. Kreil (Boku)
Ah, yes, the need to condense escaped me. I thought you wanted to write out the final result separated by commas. You will need to do the condensing separately. Unless someone else has a more elegant idea, I guess something along the lines of df2srcs-unique(dataframe2$Src);

Re: [R] combine the data frames into comma separated list.

2011-06-13 Thread Gabor Grothendieck
On Mon, Jun 13, 2011 at 5:17 PM, Mary Kindall mary.kind...@gmail.com wrote: Hi R users, I am new to R and am trying to merge data frames in the following way. Suppose I have n data frames each with two fields. Field 1 is common among data frames but may have different entries. Field 2 is

Re: [R] combine the data frames into comma separated list.

2011-06-13 Thread Dr. D. P. Kreil (Boku)
now that's beautiful! :-) Many thanks, David. Try this where DF1, DF2 and DF3 are the data frames: L - list(DF1, DF2, DF3) merge.all - function(...) merge(..., all = TRUE) Reduce(merge.all, lapply(L, function(x) aggregate(x[2], x[1], toString))) The last line gives this:  Src      

[R] functions for polynomial and rational interplation?

2011-06-13 Thread dslowik
Are there implementations of, e.g. Neville's algorithm, for interpolating polynomials through some data points? Nevilles' is an improvement on Lagrange interpolation. And how about interpolating rational functions? I could not find anything at rseek.org or at crantastic.org. thanks -- View this

[R] Off-topic: (Simple?) Random Sampling when n is a random variable

2011-06-13 Thread Andrew Robinson
Hi everyone, I'm involved in a discussion with a colleague. He suggested a sample design for a finite-sized process that (to all intents and purposes) involves tossing a coin and examining the unit if the coin shows Heads. I should emphasize that we're both approaching the problem from a

Re: [R] How to compute the P-value for a mixture of chi^2 distributions

2011-06-13 Thread Tiago Pereira
Thanks for your very constructive and helpful tips, Peter and Ted! -- View this message in context: http://r.789695.n4.nabble.com/How-to-compute-the-P-value-for-a-mixture-of-chi-2-distributions-tp3591276p3595373.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] functions for polynomial and rational interplation?

2011-06-13 Thread Bill.Venables
Neville's algorithm is not an improvement on Lagrange interpolation, it is simply one way of calculating it that has some useful properties. The result is still the Lagrange interpolating polynomial, though, with all its flaws. Implementing Neville's algorithm is fairly easy using the PolynomF

Re: [R] Question about license for redistribution of R package

2011-06-13 Thread Duncan Murdoch
On 11-06-13 1:22 PM, Iyer wrote: Hello, I would like to distribute an R package along with an application. The package is written exclusively in R. Since the package does not make sense outside of the application it does not make sense to submit it to CRAN. I have a question regarding

[R] Analyzing three-way contingency tables with many zero cells

2011-06-13 Thread James Bull
Hi all, I am trying to analyze the following data. The first three columns are categorical variables (colors of three traits for a peripatus species) and the last column the count of individuals in each three-way classification. I wish to test if the three traits vary independently or if

[R] About 'hazard ratio', urgent~~~

2011-06-13 Thread karena
Hi, I am new to R. My question is: how to get the 'hazard ratio' using the 'coxph' function in 'survival' package? thanks, karena -- View this message in context: http://r.789695.n4.nabble.com/About-hazard-ratio-urgent-tp3595527p3595527.html Sent from the R help mailing list archive at

Re: [R] combine the data frames into comma separated list.

2011-06-13 Thread Mary Kindall
Superb Gabor, Though I dont know what is happening, but yes it is workin and without fail. Thanks - M On Mon, Jun 13, 2011 at 8:20 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Mon, Jun 13, 2011 at 5:17 PM, Mary Kindall mary.kind...@gmail.com wrote: Hi R users, I am new to R

[R] Change Data Point Label in biplot()

2011-06-13 Thread Bao, Yongjian (GE Healthcare)
I'm a new user of R, and trying to display the result of a PCA data set with biplot(). Biplot() draws the projections of data points to the first two principal axis with a text level (I guess it is the name of the data points). This makes the picture very crowed. I tried to go through R