Re: [R] get is.na !is.na count of various combinations of columns

2014-03-19 Thread arun
Hi, I just noticed that you also have all is.na() or !is.na() subsets.  To do that: mydatatest - structure(list(CaseID = structure(1:8, .Label = c(1605928, 1605943, 1605945, 1605947, 1605949, 1605951, 1605952, 1605953), class = factor), Structure = structure(c(1L, 1L, 3L, 2L, 2L, 3L, 3L, 4L),

Re: [R] Data file verification protocol

2014-03-19 Thread Barry Rowlingson
On Wed, Mar 19, 2014 at 4:03 AM, Wolf, Steven wolfs...@msu.edu wrote: Hi R users, This isn't a R-specific issue, per-se, but I thought that this list would have some helpful input on this topic. First, a bit of background. I am working on a project which is interested in following approx

[R] [R-pkgs] New package metap on CRAN

2014-03-19 Thread Michael Dewey
This package provides meta-analysis of significance values. Although the preferred way of performing meta-analysis uses effect sizes sometimes these are unavailable and only p-values can be obtained from the primary studies. The metap package provides several ways of synthesising p-values and

Re: [R] Data file verification protocol

2014-03-19 Thread rex
Wolf, Steven wolfs...@msu.edu [2014-03-18 21:05]: I am looking for a verification protocol which can look at a data file and see if it has been modified. Ideally, this should be something that I can check the file with to see if the file has been changed or corrupted and incorporate into

[R] write.csv: set the name of the column containing the row.names

2014-03-19 Thread Luca Cerone
Hi everybody, I am sorry if this is a silly question (I have tried to search it at http://tolstoy.newcastle.edu.au/R/ but I get a 404 page). I have a script writing some data.frames to csv files. I write the csv files using the write.csv function and the option row.names=TRUE. Everything works

Re: [R] write.csv: set the name of the column containing the row.names

2014-03-19 Thread Ista Zahn
The argument is col.names, not colnames. Best, Ista On Mar 19, 2014 6:14 AM, Luca Cerone luca.cer...@gmail.com wrote: Hi everybody, I am sorry if this is a silly question (I have tried to search it at http://tolstoy.newcastle.edu.au/R/ but I get a 404 page). I have a script writing some

Re: [R] write.csv: set the name of the column containing the row.names

2014-03-19 Thread Luca Cerone
Thanks Ista, sorry it was a typo in my email, but in the code I have the right option. On Wed, Mar 19, 2014 at 11:58 AM, Ista Zahn istaz...@gmail.com wrote: The argument is col.names, not colnames. Best, Ista On Mar 19, 2014 6:14 AM, Luca Cerone luca.cer...@gmail.com wrote: Hi everybody,

Re: [R] write.csv: set the name of the column containing the row.names

2014-03-19 Thread Luca Cerone
Thanks Duncan, I knew that, I wanted to know if there was some way not involving having to recreate the df. It is not a big issue in this case (they are not very big), but it might be problematic for big data frames. Thanks for advice on using col.names=NA. Cheers, Luca Luca Cerone Tel: +34 692

Re: [R] write.csv: set the name of the column containing the row.names

2014-03-19 Thread Rui Barradas
Hello, write.csv(df, row.names=TRUE, col.names=c(ID, colnames(df))) ,a,b A,1,3 B,2,4 C,3,5 Warning message: In write.csv(df, row.names = TRUE, col.names = c(ID, colnames(df))) : attempt to set 'col.names' ignored This gives a warning, not an error message. I've also tried setting col.names

[R] computationally singular

2014-03-19 Thread Matthias Endres
Hi Weiwei, I found your post on Mahalanobis distances five years ago. / Error in solve.default(cov, ...) : system is computationally singular: // reciprocal condition number = 1.09501e-25 /I have the same problem now - and I don't know how to deal with it. I would be thankful if you could

[R] Fwd: help

2014-03-19 Thread Mehrshad Koleini
Topic: importing data from a web page Dear Sir/ Madam Hi. First I apologize for this question. But this also shows I'm inexperienced in using R. I need to import some tables from a web page (https) into R and analyze them through the readHTMLTable function. After loading XML package, the

[R] Row names at the end of the record

2014-03-19 Thread Ankush Sharma
HI all How to add row names at the end of the record after transposing a matrix Sample code Data = read.table(set_a_2.txt,header = TRUE, sep = \t) Data.T - t(Data[,0:ncol(fooData)]) write.table(Data.T, file =set_a_2_format.tab,row.names = TRUE, col.names = TRUE, quote = FALSE) example of

[R] [R-pkgs] RSelenium package

2014-03-19 Thread John Harrison
I would like to announce the release of version 1.2.2 of the RSelenium package on CRAN. RSelenium is an R package that provides a set of R bindings for the Selenium 2.0 webdriver. Selenium automates browsers. Using RSelenium you can automate browsers locally or remotely. The set of supported

Re: [R] Row names at the end of the record

2014-03-19 Thread PIKAL Petr
Hi Not sure what you exactly want but some comments in line -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Ankush Sharma Sent: Wednesday, March 19, 2014 11:36 AM To: r-help@r-project.org Subject: [R] Row names at the end of

Re: [R] Fwd: help

2014-03-19 Thread PIKAL Petr
Hi Although I am not experienced with XML package the warning seems pretty straightforward to me. The object you want to load is not recognised as XML. Most probably readHTMLTable requires some format as input and your url is not accepted. Regards Petr -Original Message- From:

Re: [R] help

2014-03-19 Thread peter dalgaard
On 19 Mar 2014, at 11:10 , Mehrshad Koleini mehrkole...@gmail.com wrote: I need to import some tables from a web page (https) into R and analyze them through the readHTMLTable function. After loading XML package, the following commands are run: url -

Re: [R] Row names at the end of the record

2014-03-19 Thread Noah Marconi
Is this what you're trying to do? mtrx - structure(c(BB, AB, BB, BB, BB, BB, AA, BB, BB, BB, BB, BB, AB, AB, BB, AA, BB, BB, BB, BB, BB, AB, BB, BB, BB), .Dim = c(5L, 5L), .Dimnames = list( c(rs1, rs2, rs3, rs4, rs5), c(LG_1,

Re: [R] Fwd: R basic data manipulation Queries

2014-03-19 Thread arun
HI, It seems like you used ?attach().  Better would be to use ?with. set.seed(45) dat1 - as.data.frame(matrix(sample(LETTERS,80,replace=TRUE),20,4)) lapply(dat1,levels) ##get the levels of all the dataset variables in a list  with(dat1,levels(V1)) A.K. I have another question, at the

[R] Does a survival probability(the probability not experiencing an event) have to be non-increasing?

2014-03-19 Thread Zhiyuan Sun
My question is related to a cox model with time-dependent variable. When I think about it more, I get a little confused about non-increasing assumption for survival probability for an individual. For example, for a time-dependent ,say x, assuming increasing x increases the risk of event.

[R] fitting

2014-03-19 Thread IZHAK shabsogh
given the data below x1-c(-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1) y-c(-1,-1,-1,0,0,0,1,1,1,-1,-1,-1,0,0,0,1,1,1,-1,-1,-1,0,0,0,1,1,1) z-c(-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1) using maple i can fit as below and get (1) #PolynomialFit(3, x1,

[R] ZOO objects: Creating, Plotting, Analyzing

2014-03-19 Thread Rich Shepard
I need to plot and analyze irregular time series. Having read the JSS article on zoo (2005), ?zoo, ?plot.zoo, and the quickref vignette I'm still not doing this correctly. My work flow is to read the *.csv file to create a dataframe, convert the df to a matrix using as.matrix() (see

Re: [R] Help with finding mean at 1 second interval

2014-03-19 Thread arun
Hi Satish, Pascal's suggestion is better. Please use ?dput() to show the example data.  op - options(digits.secs=6) library(zoo) ##added a couple more rows  dat - read.zoo(text=V1 V2 V3 V4 V5 V6 '2014-03-14 22:41:46.988804'  10   2   8   3  14 '2014-03-14 22:41:46.991126'  13   4   9   5  15

Re: [R] package environment versus namespace environment

2014-03-19 Thread Suraj Gupta
As the author of that post, I must respond... # - first comment --- Ducan: The article that Henrik cited gives a reasonable description up until near the end Suraj: Given the complexity of the topics at hand, the many accolades I've received for the post, and how thoroughly I've

Re: [R] package environment versus namespace environment

2014-03-19 Thread Mark Leeds
Hi Everyone: Suraj will respond to Duncan's comments below promptly. Suraj doesn't have the original thread so I am just helping out by commenting here so that he can respond and the thread can be kept continuous. Mark On Sun, Mar 9, 2014 at 9:09 AM, Duncan Murdoch

Re: [R] Reshaping Data in R - Transforming Two Columns Into One

2014-03-19 Thread PIKAL Petr
Hi Isn't melt just what you want? melt(mydt) Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Abraham Mathew Sent: Tuesday, March 18, 2014 1:59 AM To: r-help@r-project.org (r-help@r-project.org) Subject: [R] Reshaping

[R] Calculations with aggregate data: mean +/- standard deviation

2014-03-19 Thread Luigi Marongiu
Dear all, I have obtained the averages (means) and standard deviations (SD) of different variable using the aggregate function, which I have found very useful for these kind of computation. However I would like to calculate the lower and upper ends of the data (that is mean - SD and mean + SD)

[R] ZOO objects: Creating, Plotting, Analyzing

2014-03-19 Thread Rich Shepard
I need to plot and analyze irregular time series. Having read the JSS article on zoo (2005), ?zoo, ?plot.zoo, and the quickref vignette I'm still not doing this correctly. This did not post to the list with the dput() outputs attached; they are at the end of this message. My work flow is to

[R] reading row title

2014-03-19 Thread eliza botto
Dear R-Family, I have a data-set of the following format. I am only presenting a part of it. DateA B C D 1-Jan-61 0.00 1.27 8.128 0.25 2-Jan-61 6.10 9.144 94.742

Re: [R] reading row title

2014-03-19 Thread eliza botto
Dear Arun and Jim, Thanks for your replies. I will be extremely careful next time.Anyway, here is the dput format of dat dput(dat) structure(list(Date = c(1-Jan-61, 2-Jan-61, 3-Jan-61, 4-Jan-61, 5-Jan-61, 6-Jan-61, 7-Jan-61, 8-Jan-61, 9-Jan-61, 10-Jan-61), A = c(0, 6.1, 0, 0, 0, 0, 0, 0, 0,

Re: [R] reading row title

2014-03-19 Thread arun
Hi, dat - read.table(text=Date   A    B   C    D 1-Jan-61   0.00  1.27   8.128  0.25 2-Jan-61 6.10 9.144 94.742 15.49 3-Jan-61  0.00 0.508  1.27 0.00 4-Jan-61  0.00  0  NA 0.00 5-Jan-61  0.00  0  0 0.00 6-Jan-61   0.00  NA  0 0.00 7-Jan-61  0.00  0  0 0.00 8-Jan-61  0.00  NA  0 0.00 9-Jan-61 

Re: [R] Calculations with aggregate data: mean +/- standard deviation

2014-03-19 Thread Rui Barradas
Hello, Maybe something like the following. res - merge(AVG, SD, by = stimulation) names(res)[2:3] - c(AVG, SD) res$lower - res$AVG - res$SD res$upper - res$AVG + res$SD res Hope this helps, Rui Barradas Em 19-03-2014 18:15, Luigi Marongiu escreveu: Dear all, I have obtained the averages

Re: [R] Does a survival probability(the probability not experiencing an event) have to be non-increasing?

2014-03-19 Thread Federico Lasa
Don't really understand your equations but. If X is the (random variable of) time of event, then the survival S(x) = 1 - Pr( X x ) has to be non increasing since: If t1 t2. then S(t1) - S(t2) = Pr(X t2) - Pr( X t1 ) = Pr( t1 X t2) 0 which means that S(t1) S(t2). But you must not

[R] cforest sampling methods

2014-03-19 Thread Maggie Makar
Hi all, I've been using the randomForest package and I'm trying to make the switch over to party. My problem is that I have an extremely unbalanced outcome (only 1% of the data has a positive outcome) which makes resampling methods necessary. randomForest has a very useful argument that is

Re: [R] cforest sampling methods

2014-03-19 Thread Max Kuhn
You might look at the 'bag' function in the caret package. It will not do the subsampling of variables at each split but you can bag a tree and down-sample the data at each iteration. The help page has an examples bagging ctree (although you might want to play with the tree depth a little). Max

Re: [R] package environment versus namespace environment

2014-03-19 Thread Duncan Murdoch
On 14-03-19 1:18 PM, Suraj Gupta wrote: As the author of that post, I must respond... # - first comment --- Ducan: The article that Henrik cited gives a reasonable description up until near the end Suraj: Given the complexity of the topics at hand, the many accolades I've received

[R] ZOO objects: Creating, Plotting, Analyzing

2014-03-19 Thread Rich Shepard
I need to plot and analyze irregular time series. Despite reading the 2005 JSS article on zoo, ?zoo, ?plot.zoo, and the quickref vignette I'm still not doing this correctly. dput() output of a matrix and the zoo object are at the end of this message. My work flow is to read the *.csv file to

[R] 2013-06-28 coverts to 15884?

2014-03-19 Thread Jason Rupert
MaxUpdated_row-NULL MaxUpdated_val- 2013-06-28 rbind(MaxUpdated_row, as.Date(MaxUpdated_val, %Y-%m-%d))   [,1] [1,] 15884 c(MaxUpdated_row, as.Date(MaxUpdated_val, %Y-%m-%d)) [1] 15884 c(MaxUpdated_row, MaxUpdated_val) [1] 15884 Evidently, I'm again missing something simple, as I would

Re: [R] 2013-06-28 coverts to 15884?

2014-03-19 Thread Jim Lemon
On 03/20/2014 08:46 AM, Jason Rupert wrote: MaxUpdated_row-NULL MaxUpdated_val- 2013-06-28 rbind(MaxUpdated_row, as.Date(MaxUpdated_val, %Y-%m-%d)) [,1] [1,] 15884 c(MaxUpdated_row, as.Date(MaxUpdated_val, %Y-%m-%d)) [1] 15884 c(MaxUpdated_row, MaxUpdated_val) [1] 15884 Evidently,

Re: [R] 2013-06-28 coverts to 15884?

2014-03-19 Thread Jason Rupert
Not sure I follow. I would like the date formatting information preserved as is implemented when using as.character: MaxUpdated_row-NULL MaxUpdated_val- 2013-06-28 c(MaxUpdated_row, as.character(MaxUpdated_val)) [1] 2013-06-28 However, when I try to used as.Date(...) I loose the date

Re: [R] 2013-06-28 coverts to 15884?

2014-03-19 Thread William Dunlap
Instead of making your initial value of MaxUpdated_row NULL, make it a 0-long Date object. Then c() will work as you wish (but not rbind). E.g., MaxUpdated_row - as.Date(character(0)) MaxUpdated_row - c(MaxUpdated_row, as.Date(2013-06-28, %Y-%m-%d)) MaxUpdated_row - c(MaxUpdated_row,

Re: [R] package environment versus namespace environment

2014-03-19 Thread Mark Leeds
Hi Duncan: If you think there is anything incorrect in the document, I'd be interested because I refer to that document whenever I'm confused about namespaces, importing etc. Thanks. On Wed, Mar 19, 2014 at 4:31 PM, Duncan Murdoch murdoch.dun...@gmail.comwrote: On 14-03-19 1:18 PM, Suraj

[R] How to fix the warning message the condition has length 1 and only the first element will be used?

2014-03-19 Thread jcrosbie
I'm trying to create a function to return the date x months in the past. With the code below I'm getting the warning message: Warning message: In if (MonthsBack = CurrentMonth) { : the condition has length 1 and only the first element will be used ## DateBack -

Re: [R] 2013-06-28 coverts to 15884?

2014-03-19 Thread Pascal Oettli
Hello, It works for me: R MaxUpdated_row - NULL R MaxUpdated_val - 2013-06-28 R R R rbind(MaxUpdated_row, as.Date(MaxUpdated_val, %Y-%m-%d)) [,1] [1,] 15884 R c(MaxUpdated_row, as.Date(MaxUpdated_val, %Y-%m-%d)) [1] 15884 R c(MaxUpdated_row, MaxUpdated_val) [1] 2013-06-28 R Regards,

Re: [R] How to fix the warning message the condition has length 1 and only the first element will be used?

2014-03-19 Thread Franklin Bretschneider
Hi jcrosbie , Re: I'm trying to create a function to return the date x months in the past. With the code below I'm getting the warning message: Warning message: In if (MonthsBack = CurrentMonth) { : the condition has length 1 and only the first element will be used Use ifelse(),

Re: [R] ZOO objects: Creating, Plotting, Analyzing

2014-03-19 Thread Achim Zeileis
On Wed, 19 Mar 2014, Rich Shepard wrote: I need to plot and analyze irregular time series. Despite reading the 2005 JSS article on zoo, ?zoo, ?plot.zoo, and the quickref vignette I'm still not doing this correctly. dput() output of a matrix and the zoo object are at the end of this message.

Re: [R] ZOO objects: Creating, Plotting, Analyzing

2014-03-19 Thread Rich Shepard
On Thu, 20 Mar 2014, Achim Zeileis wrote: It's sufficient to send such messages once even if others don't reply within minutes. Achim, I sent it but my postfix spam filter would not let it out. There should have been only a single copy. Please have a look at read.zoo() and the

Re: [R] 2013-06-28 coverts to 15884?

2014-03-19 Thread Jim Lemon
On 03/20/2014 09:57 AM, Jason Rupert wrote: Not sure I follow. I would like the date formatting information preserved as is implemented when using as.character: MaxUpdated_row-NULL MaxUpdated_val- 2013-06-28 c(MaxUpdated_row, as.character(MaxUpdated_val)) [1] 2013-06-28 However, when I try to