[R] How to calculate correlation matrix for 128 * 12625 matrix

2012-05-30 Thread mahdi
In our dataset the samples/object are number of patients which is 128 and we are dealing with 12,625 genes which is our attributes of the dataset. So, it is obvious that if I calculate the correlation matrix of (128 * 12,625) the resulted dimension of the correlation matrix will be (12,625 *

Re: [R] Simple example for High performance computing with R?

2012-05-30 Thread Martin Morgan
On 05/29/2012 08:02 PM, Fabrice Tourre wrote: Dear list, I want to run two independent calculation (A, B) and then combined their results to do a plot in R. Before I just run calculation A first, then calculation B. It will take some times. I just have one server with multiple core. I noticed

Re: [R] strucchange Fstats() example

2012-05-30 Thread Achim Zeileis
On Tue, 29 May 2012, Mabille, Geraldine wrote: snip In the second example, the authors state the presence of at least two breakpoints. When plotting the F-statistics using the following code, we see indeed two peaks in the F-statistics, that coincides with the dates given by the authors: c.a

Re: [R] importing multiple file form folder

2012-05-30 Thread mpavlic
Hi Jim, thanks for that, works perfectly. m -- View this message in context: http://r.789695.n4.nabble.com/importing-multiple-file-form-folder-tp4631637p4631798.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org

Re: [R] Wilcoxon-Mann-Whitney U value: outcomes from different stat packages

2012-05-30 Thread peter dalgaard
On May 29, 2012, at 17:55 , maxbre wrote: Given this example #start code a-c(0,70,50,100,70,650,1300,6900,1780,4930,1120,700,190,940, 760,100,300,36270,5610,249680,1760,4040,164890,17230,75140,1870,22380,5890,2430) b-c(0,0,10,30,50,440,1000,140,70,90,60,60,20,90,180,30,90,

Re: [R] Wilcoxon-Mann-Whitney U value: outcomes from different stat packages

2012-05-30 Thread peter dalgaard
On May 29, 2012, at 17:55 , maxbre wrote: Given this example #start code a-c(0,70,50,100,70,650,1300,6900,1780,4930,1120,700,190,940, 760,100,300,36270,5610,249680,1760,4040,164890,17230,75140,1870,22380,5890,2430) b-c(0,0,10,30,50,440,1000,140,70,90,60,60,20,90,180,30,90,

Re: [R] R and igraph problems

2012-05-30 Thread Prof Brian Ripley
On 30/05/2012 00:23, jalantho...@verizon.net wrote: I have R 2.15.0 running under Windows 7. I installed the igraph 0.5.4 package from a zip file. When I attempt to load igraph using library(igraph), I get the error package igraph is not installed for arch=x64. When I repeat this using the

Re: [R] Simple example for High performance computing with R?

2012-05-30 Thread Prof Brian Ripley
On 30/05/2012 04:02, Fabrice Tourre wrote: Dear list, I want to run two independent calculation (A, B) and then combined their results to do a plot in R. Before I just run calculation A first, then calculation B. It will take some times. I just have one server with multiple core. I noticed that

Re: [R] odfWeave fails to load

2012-05-30 Thread Uwe Ligges
See http://cran.r-project.org/web/checks/check_results_odfWeave.html which indicates the package has some problems. Hence CRAN does not make binaries available. Please contact the maintainer. Best, Uwe Ligges On 29.05.2012 16:23, stephenb wrote: R version 2.15.0 (2012-03-30) Copyright

Re: [R] RODBC, Excel, and data truncation when writing

2012-05-30 Thread Uwe Ligges
On 29.05.2012 17:27, Steven Lacey wrote: Hi, I am hoping to use the RODBC package to write a dataframe to an Excel .xlsx file. The dataframe contains at least one field with character elements that exceed 255 bytes, which appears to be the cell width limit in Excel. Below is example code and

Re: [R] Memory Windows

2012-05-30 Thread Uwe Ligges
On 29.05.2012 18:52, Emiliano Zapata wrote: This is my current version of R: R version 2.15.0 (2012-03-30) Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-pc-mingw32/x64 (64-bit) OS: Windows I get the following: memory.size() [1] 23.04

Re: [R] GLMMPQL spatial autocorrelation

2012-05-30 Thread ONKELINX, Thierry
Dear Alex, I'm cc'ing this to the mixed models list which is more appropriate for the question. Please send all follow up posts only to that list. First a few more general remarks. - You are using the data argument of glmmPQL. So there is no need to attach() the data.frame. I recommend avoid

[R] alternative generator for normal distributed variables

2012-05-30 Thread juliane0212
Hello, currently I'm working on a model based on Monte-Carlo-Simulations. I observed that a generated normal distributed times series using rnorm(100,mean=0,sd=1) is far away from being not autocorrelated. Is there any other gerenator implemented in R, which might solve my problem? -- View

Re: [R] alternative generator for normal distributed variables

2012-05-30 Thread ONKELINX, Thierry
Please give a reproducible example when making bold statements. I find no evidence of autocorrelation in set.seed(12345) x - rnorm(100, mean = 0, sd = 1) acf(x) x - rnorm(1e6, mean = 0, sd = 1) acf(x) ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature

[R] (no subject)

2012-05-30 Thread Marianna Chimienti
Hy guys, I have built a 3dimentional array that is meant to be a 3D landscape for my simulation game. Do you know if there is some package that allow me to plot the image? I am looking at all 3D plots but nothing seems to be right. Should I use the rgl package? Thank you very much Marianna

Re: [R] Package for partially ordered sets

2012-05-30 Thread Thomas Kiefer
maybe the package DAKS can be of any help. -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von Christian Kampichler Gesendet: Dienstag, 29. Mai 2012 15:50 An: r-help@r-project.org Betreff: [R] Package for partially ordered sets

[R] Rcurl package for windows - Need help

2012-05-30 Thread santoshdvn
Hi All, Where can i download Rcurl package for windows. Regards, Santosh -- View this message in context: http://r.789695.n4.nabble.com/Rcurl-package-for-windows-Need-help-tp4631799.html Sent from the R help mailing list archive at Nabble.com. __

[R] Help needed for this error

2012-05-30 Thread Dinesh Vakamudi
results - mra(x$w1mcp, filter = d4, n.levels = 3, boundary = periodic, method = dwt) write.csv(results, c:/mydata.csv) Error in as.data.frame.default(x[[i]], optional = TRUE) : cannot coerce class 'structure(mra, package = wavelets)' into a data.frame I am not able to access data stored in

Re: [R] use xyplot to plot mean and CI by groups

2012-05-30 Thread csrabak
Em 29/5/2012 17:42, John Smith escreveu: Dear R users, I am trying to use xyplot to draw group mean and CI. The following is the sample code. [attached code snipped] Did you try the plotmeans function from the gplots package? But I want: 1. Use different colors and symbols to draw

[R] Separate Array Variable Content

2012-05-30 Thread Rantony
Hi, I am new in R, i have a matrix like this MyMatrix - *ABC PQRXYZ* 10 2030 40 5060 70 8090 And, i have an array containing some conditions like this, MyArray - c(*ABC*50,*PQR*50,*ABC*30 * XYZ*40) ABC50 PQR50 ABC30 XYZ40 My purpose what is,

Re: [R] Windows 7 installation issues

2012-05-30 Thread jalantho...@verizon.net
Yes, there was a typo in my message. The problem remains. [[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

Re: [R] GAM interactions, by example

2012-05-30 Thread Simon Wood
Geraldine, They really are the same fit, try... range(fitted(b)-fitted(b1)) [1] -3.333782e-10 4.173699e-10 ... for example. The edf differences are just down to differences in how identifiability constraints are handled in the two cases. For b1 the smooths of x2 do not have centring

[R] R learning

2012-05-30 Thread paragkulkarni11
Hi, What is quickest way to learn R? I am unnecessarily having fear of learning R. rgds Parag Kulkarni Haridwar,India -- View this message in context: http://r.789695.n4.nabble.com/R-learning-tp4631814.html Sent from the R help mailing list archive at Nabble.com.

[R] caret() train based on cross validation - split dataset to keep sites together?

2012-05-30 Thread Tyrell Deweber
Hello all, I have searched and have not yet identified a solution so now I am sending this message. In short, I need to split my data into training, validation, and testing subsets that keep all observations from the same sites together – preferably as part of a cross validation procedure. Now

Re: [R] R and igraph problems

2012-05-30 Thread jalantho...@verizon.net
Thank you. This version worked. [[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

Re: [R] Rcurl package for windows - Need help

2012-05-30 Thread Nicolas Iderhoff
Google.com - “cran rcurl“ windows binary not available - read me skip through file, find: “Packages GLMMGibbs, RCurl, XMLRPC, XML, gridSVG, survnnet, yags do not build out of the box or other special in other circumstances. Nevertheless these are available at

Re: [R] R learning

2012-05-30 Thread Nicole Marie Ford
these are two great books that helped me significantly. Verzani, John. 2004. Using R for Introductory Statistics. Chapman Hall/CRC. (here- after JV) Errata: http://wiener.math.csi.cuny.edu/UsingR/Errata/ John Fox and Sanford Weisberg. An R Companion to Applied Regression. Sage Publications,

Re: [R] (no subject)

2012-05-30 Thread Sarah Goslee
Well, what do you want it to look like? My first thought was topography, but that can't be right because you don't need a three-dimensional array for that. So tell us more. What does your array contain, what's its structure, and what kind of visualization are you trying to get? Sarah On Wed,

Re: [R] Help needed for this error

2012-05-30 Thread Sarah Goslee
Hi, On Wed, May 30, 2012 at 7:48 AM, Dinesh Vakamudi dinesh.vakam...@gmail.com wrote: results - mra(x$w1mcp, filter = d4, n.levels = 3, boundary = periodic, method = dwt) write.csv(results, c:/mydata.csv) I have no idea what mra() is - from what package did it come? I see there's a package

Re: [R] alternative generator for normal distributed variables

2012-05-30 Thread R. Michael Weylandt
Like Thierrey I entirely disagree with you, but there are many PRNGs in R -- take a look at ?RNGkind to change them. Michael On Wed, May 30, 2012 at 7:39 AM, juliane0212 stephan...@web.de wrote: Hello, currently I'm working on a model based on Monte-Carlo-Simulations. I observed that a

Re: [R] How to calculate correlation matrix for 128 * 12625 matrix

2012-05-30 Thread R. Michael Weylandt
On Tue, May 29, 2012 at 11:26 PM, mahdi mahd...@gmail.com wrote: In our dataset the samples/object are number of patients which is 128 and we are dealing with 12,625 genes which is our attributes of the dataset. So, it is obvious that if I calculate the correlation matrix of (128 * 12,625) the

Re: [R] alternative generator for normal distributed variables

2012-05-30 Thread Jorge I Velez
Hi there, I am not an expert, but simple experimentation using the acf() function shows that your statement is not true (see ?acf and ?replicate for more information): foo - function(x) acf(x, plot = FALSE)$acf[,,1] result - replicate(1, foo(rnorm(100))) result - t(apply(result, 1, quantile,

Re: [R] (no subject)

2012-05-30 Thread R. Michael Weylandt
You might try looking at demo(persp) as well. Michael On Wed, May 30, 2012 at 9:42 AM, Sarah Goslee sarah.gos...@gmail.com wrote: Well, what do you want it to look like? My first thought was topography, but that can't be right because you don't need a three-dimensional array for that. So

Re: [R] caret() train based on cross validation - split dataset to keep sites together?

2012-05-30 Thread Max Kuhn
Tyrell, If you want to have the folds contain data from only one site at a time, you can develop a set of row indices and pass these to the index argument in trainControl. For example index = list(site1 = c(1, 6, 8, 12), site2 = c(120, 152, 176, 178), site3 = c(754, 789, 981)) The first fold

Re: [R] Customized R Regression Output?

2012-05-30 Thread Greg Snow
Are the x variables all the same? if so, you can give lm a matrix as the y variable and it will compute all the different regressions for each column in the y matrix. The summary function will then return a list with the summary information for each of the regressions. If the x variables are

Re: [R] R learning

2012-05-30 Thread Patrick Burns
You have already had one response that interpreted learn R as use R to do statistics. I have a rather different interpretation of learn R. An answer to that interpretation (learn the mechanics of the language) is: http://www.burns-stat.com/pages/Tutor/hints_R_begin.html If you search the web,

Re: [R] Separate Array Variable Content

2012-05-30 Thread ilai
If you haven't done so you *must* read an Introduction to R. The only reason this is a problem is Myarray is a character string, not a function or expression to be evaluated. I think this will get you what you want though: # In the future use the output of ?dput to provide data to this list

[R] problem with ifelse

2012-05-30 Thread Christopher Kelvin
Dear all,  The code below is used to generate interval censored data but unfortunately there is an error with the ifelse which i am not able to rectify.  Can somebody help correct it for me. Thank you t-rexp(20,0.2)  v-c(0,m,999)  y-function(t,v){   z-numeric(length(t ((     s-numeric(length(t

[R] anova.coxph for multiple events model

2012-05-30 Thread Andreia Leite
Hi, I'm trying to do a multiple events model using coxph. I need to choose which covariates stay in the final model and i'm using anova but it seems that it doesn't work with robust variances as a error message appears when I try to do it:

[R] reading file in zip archive

2012-05-30 Thread Iain Gallagher
Hi List I have a series of zip archives each containing several files. One of these files is called goCats.txt and I would like to read it into R from the archive. It's a simple tab delimited text file. pathToZip -

Re: [R] problem with ifelse

2012-05-30 Thread Sarah Goslee
Hi, The error with ifelse() seems to be that you have no idea what ifelse() does. As far as I can tell, you tried to construct code that does something like this: y-function(tdata,v){ z - rep(NA, length(tdata)) s - z for(i in 1:length(tdata)) { for(j in 1:length(v-1)) {

Re: [R] reading file in zip archive

2012-05-30 Thread Phil Spector
Iain - Once you specify the file to unzip in the call to unz, there's no need to repeat the filename in read.table. Try: z - unz(pathToZip, 'goCats.txt', 'r') zT - read.table(z, header=TRUE, sep='\t') (Although I can't reproduce the exact error which you saw.)

Re: [R] Help needed for this error

2012-05-30 Thread Peter Ehlers
On 2012-05-30 06:48, Sarah Goslee wrote: Hi, On Wed, May 30, 2012 at 7:48 AM, Dinesh Vakamudi dinesh.vakam...@gmail.com wrote: results- mra(x$w1mcp, filter = d4, n.levels = 3, boundary = periodic, method = dwt) write.csv(results, c:/mydata.csv) I have no idea what mra() is - from what

Re: [R] reading file in zip archive

2012-05-30 Thread Iain Gallagher
Hi Phil Thanks, but this still doesn't work. Here's a reproducible example (was wrapping my head around these functions before). x - as.data.frame(cbind(rep('a',5), rep('b',5))) y - as.data.frame(cbind(rep('c',5), rep('d',5))) write.table(x, 'x.txt', sep='\t', quote=FALSE) write.table(y,

Re: [R] problem with ifelse

2012-05-30 Thread Sarah Goslee
Since your code has things like this: z-numeric(length(t (( either you have a serious problem with your email client or you need to reread some introductory material and take a hard look at your code. Also note that g() doesn't work, because it contains the statement return(m) but m is undefined

[R] Identifying words ending with anything, say ing

2012-05-30 Thread aksay1210
Can i know how to identify words ending with ing, say playing,praying,remembering etc. I want to remove such words using removeWords function. -- View this message in context: http://r.789695.n4.nabble.com/Identifying-words-ending-with-anything-say-ing-tp4631834.html Sent from the R help

Re: [R] How to open a file with a name changed?

2012-05-30 Thread Minerva Mora
Hi!! Thanks everybody... It works with *filname - paste(C:/Bonos/, gsub(-, , Sys.date() ) , sep=)* -- View this message in context: http://r.789695.n4.nabble.com/How-to-open-a-file-with-a-name-changed-tp4631261p4631840.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Identifying words ending with anything, say ing

2012-05-30 Thread Charlie F
#sample words words - c(fixing,Dog,Carting,kite,running,playing) #find words ending in 'ing' result - regexpr(^[a-zA-Z]+ing$,words) result [1] 1 -1 1 -1 1 1 attr(,match.length) [1] 6 -1 7 -1 7 7 attr(,useBytes) [1] TRUE # you can use result to take out the offending words: new.words -

[R] Identifying words ending with anything, say ing

2012-05-30 Thread aksay1210
Can i know how to identify words ending with ing, say playing,praying,remembering etc. I want to remove such words using removeWords function. Thanks, Akshay IIM Kozhikode -- View this message in context:

Re: [R] Identifying words ending with anything, say ing

2012-05-30 Thread aksay1210
My query comes from the background that I want to process my text and want to remove all the proper nouns.. So, by tagPOS i can tag them as /NNP and then can remove those words from the whole text. So, if someone tell me How I can do that, that would be very helpful..!! Thanks -- View this

Re: [R] Identifying words ending with anything, say ing

2012-05-30 Thread aksay1210
Thanx a lot Charlie BUT What if I have many sentences (not individual words), where I would want to remove such words ? -- View this message in context: http://r.789695.n4.nabble.com/Identifying-words-ending-with-anything-say-ing-tp4631834p4631836.html Sent from the R help mailing list archive

[R] Survival with different probabilities of censoring

2012-05-30 Thread anthonywaldron
Dear all I have a fairly funky problem that I think demands some sort of survival analysis. There are two Red List assessments for mammals: 1986 and 2008. Some mammals changed their Red List status between those dates. Those changes can be regarded as events and are interval censored in the sense

[R] Write to dynamic file name

2012-05-30 Thread gil.razial
hi, i am trying to use the write.csv function but to give a dynamic file name each time a different one but i am getting an error that he cannot open the file : TodayDate-UniqDate[1] ## this gives 04/02/2012 FileLocation-C:\\Trade Doc\\trade log\\Real account\\sys file\\Test Data\\Data breaked to

[R] raw input prompt

2012-05-30 Thread meatloafthefrog
Hello, I was wondering if there is a way to make a prompt for the user (exactly like raw_input() in Python), the response to which can then be used as an object. Thanks, Abir -- View this message in context: http://r.789695.n4.nabble.com/raw-input-prompt-tp4631852.html Sent from the R help

Re: [R] Write to dynamic file name

2012-05-30 Thread gil.razial
Solved ! the problem was the date 04/02/2012 the / made him think there is more folders thanks -- View this message in context: http://r.789695.n4.nabble.com/Write-to-dynamic-file-name-tp4631841p4631843.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Separate Array Variable Content

2012-05-30 Thread arun
HI Antony, I am not sure how you want the result. Is it something like this?  Also, do you have lots of conditions in the array? Mydat2   ABC PQR XYZ ELIGIBLE_ABC ELIGIBLE_PQR ELIGIBLE_ABC_XYZ 1  10  20  30   TRUE 2  40  50 

Re: [R] raw input prompt

2012-05-30 Thread R. Michael Weylandt
Perhaps readline()? Best, Michael On Wed, May 30, 2012 at 2:31 PM, meatloafthefrog meatloafthef...@gmail.com wrote: Hello, I was wondering if there is a way to make a prompt for the user (exactly like raw_input() in Python), the response to which can then be used as an object. Thanks,

[R] data frame to frequencies

2012-05-30 Thread cassiorx
I have a data frame that has columns Semester, Student ID (SID), Subject, Grade, Devel (Tor F). Students can have multiple records within a semester. Right now, the columns are not considered factors. I want to do an analysis that would show the number of students who received particular

Re: [R] data frame to frequencies

2012-05-30 Thread R. Michael Weylandt
I think you're looking for xtabs [see the examples; they're quite good] but I can't be sure: your printed object can't really exist in R so I'm not sure what you have currently. Michael On Wed, May 30, 2012 at 3:25 PM, cassiorx cassiodo...@hotmail.com wrote: I have a data frame that has columns

Re: [R] Separate Array Variable Content

2012-05-30 Thread David Winsemius
On May 30, 2012, at 1:04 PM, ilai wrote: If you haven't done so you *must* read an Introduction to R. The only reason this is a problem is Myarray is a character string, not a function or expression to be evaluated. I think this will get you what you want though: # In the future use the

Re: [R] raw input prompt

2012-05-30 Thread David Winsemius
On May 30, 2012, at 4:38 PM, R. Michael Weylandt wrote: Perhaps readline()? Or possibly ( depending on what exactly the undescribed Python function does) ... x - scan() # defaults to numeric but can be used for character input with correct parameters Best, Michael On Wed, May

Re: [R] data frame to frequencies

2012-05-30 Thread David Winsemius
On May 30, 2012, at 4:51 PM, R. Michael Weylandt wrote: I think you're looking for xtabs [see the examples; they're quite good] but I can't be sure: your printed object can't really exist in R so I'm not sure what you have currently. Michael On Wed, May 30, 2012 at 3:25 PM, cassiorx

[R] How to aggregate combinations

2012-05-30 Thread Oritteropus
Hi all, Given a table like the one below, I want to get a number of vectors equal to the groups of connected ID (ID are considered connected if they are in the same row). Each vector should contains all the connected ID . e.g. In this case: vect1 (1,2,3) vect2 (5,6) vect3 (7,8,9)

Re: [R] R learning

2012-05-30 Thread arun.gurubaramurugeshan
If you haven't already look at Introduction to R, please follow this link http://cran.r-project.org/doc/manuals/R-intro.pdf;. There are several books which will teach you R, please look at online retailers like Amazon, Ebay etc., Online search for specific task will also to help you to gather

[R] Extracting rows from a dataset

2012-05-30 Thread arun
Dear R help, I have a dataset with 1's and 0's.  Here, each row is the observation for an insect.  If the animal is present in light area at a particular time, response is 1 and if it is present in dark area, the response is 0.  I would like to do some formating on the data for analysis.  To

Re: [R] How to aggregate combinations

2012-05-30 Thread Rui Barradas
Hello, The problem can be solved using graph theory tools. library(igraph) edg - read.table(text= ID ID2 12 13 23 65 78 89 , header=TRUE) (G - graph(t(edg) - 1, directed=TRUE)) # igraph vertices are zero-based V(G)$name - 1:9 #V(G)$label - V(G)$name #plot(G,

Re: [R] Extracting rows from a dataset

2012-05-30 Thread Jorge I Velez
Hi A.K., Thank you for the example. Here is one way: dat[apply(dat, 1, function(x) x[1] == 1 length(rle(x)$values) 2), ] See ?rle and ?apply for more details. HTH, Jorge.- On Wed, May 30, 2012 at 5:45 PM, arun wrote: Dear R help, I have a dataset with 1's and 0's. Here, each row is

Re: [R] Extracting rows from a dataset

2012-05-30 Thread Rui Barradas
Hello, Try the following. ix - apply(dat, 1, function(x) x[1] == 1 sum(diff(x) != 0) 1) dat[ix, ] Hope this helps, Rui Barradas Em 30-05-2012 22:45, arun escreveu: Dear R help, I have a dataset with 1's and 0's. Here, each row is the observation for an insect. If the animal is present

Re: [R] reading file in zip archive

2012-05-30 Thread Peter Langfelder
On Wed, May 30, 2012 at 12:47 PM, Iain Gallagher iaingallag...@btopenworld.com wrote: Hi Phil Thanks, but this still doesn't work. Here's a reproducible example (was wrapping my head around these functions before). x - as.data.frame(cbind(rep('a',5), rep('b',5))) y -

[R] Automatically install package dependencies

2012-05-30 Thread Ronaldo Reis Júnior
Hi, I have a R Package. It is working, but I can't that it install the dependencies automatically. When I try to install I receive this message: install.packages(./RT4Bio_1.0.tar.gz,dependencies=TRUE) Installing package(s) into '/usr/local/lib/R/site-library' (as 'lib' is unspecified)

Re: [R] reading file in zip archive

2012-05-30 Thread Phil Spector
Iain - Do you see the same behaviour if you use z - unz(pathToZip, 'x.txt') instead of z - unz(pathToZip, 'x.txt','r') - Phil Spector Statistical Computing Facility

Re: [R] problem with ifelse

2012-05-30 Thread S Ellison
The code below is used to generate interval censored data but unfortunately there is an error with the ifelse which i am not able to rectify. Can somebody help correct it for me. Not quickly. But cut() might do a large part of what you need with a

Re: [R] Automatically install package dependencies

2012-05-30 Thread David Winsemius
On May 30, 2012, at 6:36 PM, Ronaldo Reis Júnior wrote: Hi, I have a R Package. It is working, but I can't that it install the dependencies automatically. When I try to install I receive this message: install.packages(./RT4Bio_1.0.tar.gz,dependencies=TRUE) Installing package(s) into

[R] gsub/strsplit with multiple patterns/splits

2012-05-30 Thread mdvaan
Hi, I have a vector like this: DF - c(Aetna, Inc., Alexander's Inc., Allegheny Energy, Inc) For each element in the vector I would like to remove the incorporated info, so that my vector looks like this: DF - c(Aetna, Alexander's, Allegheny Energy) That means that I have to strip: strip -

Re: [R] Extracting rows from a dataset

2012-05-30 Thread arun
Thanks Jorge, It worked. A.K. From: Jorge I Velez jorgeivanve...@gmail.com To: arun smartpink...@yahoo.com Cc: R help r-help@r-project.org Sent: Wednesday, May 30, 2012 6:11 PM Subject: Re: [R] Extracting rows from a dataset Hi A.K., Thank you for the

[R] Sorting a data set

2012-05-30 Thread tony.anderson
I am a novice user of R and am stumbling on how to order a dataset produced during my session. I have a 1863 row X 14 column dataset that I want to put out to a file. I want the output sorted by the first column and then by the second column both in ascending order. The first column is

[R] Probably a good use for apply

2012-05-30 Thread LCOG1
Hi all, I Have a data frame test.. that I would like to convert into a list below test_ but am unsure how to efficiently do this. I can do it in a for loop but my data set is huge and it takes forever. Wondering how I can do this more efficiently. So again how to I go from test.. to test_

[R] Best way to predict

2012-05-30 Thread Chris Burns
I have a huge matrix of unspecified covariates and the corresponding sales for them. What is the best way to predict the sales from the covariates? Thanks, Chris [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] cluster with mahalanobis distance

2012-05-30 Thread Maria Froes
How can I perform cluster analysis using the mahalanobis distance instead of the euclidean distance? Thank you Maria Froes [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Sorting a data set

2012-05-30 Thread jim holtman
If you want to sort by the columns with the names 'var1' and 'var2', you would do: newdata - data[order(data$var1, data$var2), ] On Wed, May 30, 2012 at 6:07 PM, tony.anderson tony.ander...@noaa.gov wrote: I am a novice user of R and am stumbling on how to order a dataset produced during my

Re: [R] Probably a good use for apply

2012-05-30 Thread jim holtman
try this: test.. - data.frame(Apples = c(1,3,0,0,1), Pears = c(0,0,1,0,2), Beans = + c(1,2,1,0,0)) lapply(seq(nrow(test..)), function(.row){ + do.call(c, sapply(names(test..), function(.col){ + rep(.col, test..[[.col]][.row]) + })) + }) [[1]] ApplesBeans Apples Beans

Re: [R] gsub/strsplit with multiple patterns/splits

2012-05-30 Thread jim holtman
Try this where you qualify how many characters you might match: gsub(,{0,1} Inc[.]{0,1}, , DF) [1] AetnaAlexander's Allegheny Energy On Wed, May 30, 2012 at 6:05 PM, mdvaan mathijsdev...@gmail.com wrote: Hi, I have a vector like this: DF - c(Aetna, Inc., Alexander's Inc.,

Re: [R] Best way to predict

2012-05-30 Thread Peter Langfelder
On Wed, May 30, 2012 at 4:07 PM, Chris Burns chris.bur...@gmail.com wrote: I have a huge matrix of unspecified covariates and the corresponding sales for them.  What is the best way to predict the sales from the covariates? Don't want to sound rude, but given your very vague problem

[R] Loop question

2012-05-30 Thread Sebastián Daza
Hello, I have a dataframe (Lx) with 5 Lb, and 5 Lw variables. I want to create several variables according to the loop presented below (data attached). Lx - read.csv(Lx.csv, header=T, sep=,) for (i in 1:20) { Lx$sb1[i] - Lx$Lb1[i+1]/Lx$Lb1[i] Lx$sb2[i] - Lx$Lb2[i+1]/Lx$Lb2[i] Lx$sb3[i]

Re: [R] gsub/strsplit with multiple patterns/splits

2012-05-30 Thread mdvaan
Thanks! That works like a charm, but I am not sure if I fully understand the syntax. I looked at the gsub page but still couldn't figure it out. What does the pattern part (,{0,1} Inc[.]{0,1}) do? What do the 0 and 1 within the curly brackets refer to? Also, what if, for example, I would want to

[R] transcan() imputation of categorical (factor) variables

2012-05-30 Thread David Paul
Hi, and thanks in advance. I have used the following to try to obtain singly-imputed values for missing data comprising no more than 15% of any variable in the data: library(Hmisc) some.df = read.csv(N:/.../some.csv, header = TRUE, stringsAsFactors = TRUE) some.trans - transcan(~ contin.var1

Re: [R] Best way to predict

2012-05-30 Thread Chris Burns
Yea it was meant to be a vague question. I just wanted to see what some of the answers were. It's for a project for school. We've done k nearest neighbors, principal component analysis, partial least squares, and we'll prob throw a random forest in there too. Thanks On Wed, May 30, 2012 at