[R] 100 most read R posts for 2012 (from the R blogosphere)

2012-12-31 Thread Tal Galili
Hello dear R-help members. While trying to avoid posting on this list about news from r-bloggers.com, I hope it is o.k. by you if I share the list I made of 100 "most read" R articles from the blogosphere, based on the analytics data gathered on r-bloggers.com You can see the full list at this li

Re: [R] Plot survival analysis with time dependent variables

2012-12-31 Thread moleps islon
I did.But could only find the citation-not an implementation. On Tuesday, January 1, 2013, David Winsemius wrote: > > On Dec 31, 2012, at 4:38 PM, moleps wrote: > > Dear all, >> Is there an implementation of Simon & Makuch method of plotting the >> survival function with time-dependent variables

Re: [R] Question on creating Date variable

2012-12-31 Thread Christofer Bogaso
On 01 January 2013 03:00:18, David Winsemius wrote: On Dec 31, 2012, at 11:57 AM, David Winsemius wrote: On Dec 31, 2012, at 11:54 AM, Christofer Bogaso wrote: On 01 January 2013 01:29:53, David Winsemius wrote: On Dec 31, 2012, at 11:35 AM, Christofer Bogaso wrote: On 01 January 2013 0

Re: [R] error when using subset (0 observations)

2012-12-31 Thread Irucka Embry
Hi David, thanks for the clarification. Irucka <-Original Message-> >From: David Winsemius [dwinsem...@comcast.net] >Sent: 12/31/2012 12:15:00 PM >To: iruc...@mail2world.com >Cc: jorgeivanve...@gmail.com;r-help@r-project.org >Subject: Re: [R] error when using subset (0 observations) > >

[R] Order variables automatically

2012-12-31 Thread Debs Majumdar
Hi, I have a dataset with 6 categorical variables. I have used this following code to make the variables u1-u6 ordered factors and this works well. cat1cat2 cat3 cat4 cat5 cat6   0      1     1  0     0     1   1      1     0      0     0     0 ... data<-read,table(

Re: [R] Plot survival analysis with time dependent variables

2012-12-31 Thread David Winsemius
On Dec 31, 2012, at 4:38 PM, moleps wrote: Dear all, Is there an implementation of Simon & Makuch method of plotting the survival function with time-dependent variables. I´m only able to find event.chart in Hmisc for the purpose and I would prefer the Simon and Makuch method. I believe st

Re: [R] cut ()

2012-12-31 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Dear Neal, Although David's solution (putting the right parenthesis, which I had missed) has resolved the issue, I would like to try yours as well. Could you please clarify the six elements: c(-1e-8, 0, 0, 0, 0, 1e8)? Thanks and regards, Pradip From:

Re: [R] cut ()

2012-12-31 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Dear David, Thank you so much for catching the mistake that is kind of careless. Sorry about that. Happy New Year. Pradip From: David L Carlson [dcarl...@tamu.edu] Sent: Monday, December 31, 2012 6:18 PM To: Muhuri, Pradip (SAMHSA/CBHSQ); 'R help' Subje

[R] Plot survival analysis with time dependent variables

2012-12-31 Thread moleps
Dear all, Is there an implementation of Simon & Makuch method of plotting the survival function with time-dependent variables. I´m only able to find event.chart in Hmisc for the purpose and I would prefer the Simon and Makuch method. I believe stata has it implemented for this purpose, but I can

Re: [R] Installing R-2.15.2 in Debian Wheezy/Testing

2012-12-31 Thread Jeff Newmiller
In the teaching to fish department, see http://cran.R-project.org/bin/linux/debian/ and customise your mirror as appropriate. --- Jeff NewmillerThe . . Go Live... DCN:Basics:

Re: [R] cut ()

2012-12-31 Thread David L Carlson
A misplaced right parenthesis caused the problem: p1_st_data$ob_mrj_cat <- cut (p1_st_data$obt_mrj_p, quantile (p1_st_data$obt_mrj_p, (0:5/5), include.lowest=TRUE)) Should be p1_st_data$ob_mrj_cat <- cut (p1_st_data$obt_mrj_p, quantile (p1_st_data$obt_mrj_p, (0:5/5)), include.lowest=TRUE)

Re: [R] cut ()

2012-12-31 Thread Neal H. Walfield
At Mon, 31 Dec 2012 22:25:25 +, Muhuri, Pradip (SAMHSA/CBHSQ) wrote: > The issue is that, for Utah, I am getting an instead of (42,48.7] in the > ob_mrj_cat column. The problem is likely due to comparisons of floating point numbers. Try moving your lower and upper bounds out a tiny bit. Whe

[R] cut ()

2012-12-31 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hello List, My goal is to create a 5 category variable (p1_st_data$ob_mrj_cat), based on the p1_st_data$obt_mrj_p variable, using the following code for 50 States and District of Columbia (N=51). p1_st_data$ob_mrj_cat <- cut (p1_st_data$obt_mrj_p, quantile (p1_st_data$obt_mrj_p, (0:5/5), incl

Re: [R] Installing R-2.15.2 in Debian Wheezy/Testing

2012-12-31 Thread Neal H. Walfield
At Mon, 31 Dec 2012 15:38:10 -0500, Stephen P. Molnar wrote: > The current version of R that is available in Wheezy is 2.15.1. However, > version 2.15.2 is available at CRAN sites. > ... > My question is what should be the format of the line in the sources.lists? Here's what I have: deb http:/

Re: [R] Error in plot.envfit(ef, p.max = 0.1) : (subscript) logical subscript too long

2012-12-31 Thread Gavin Simpson
Hi Laura, Following a bit of further digging, I noticed that the bug was in not handling the levels of the factor constraints appropriately. In your data set 12 rows (observations) were deleted because of missing data. These observations meant that one or more of the factor variables had more leve

Re: [R] Question on creating Date variable

2012-12-31 Thread arun
Hi, Try this: x<-c(11.00,11.25,11.35,12.01,11.14,13.00,13.25,13.35,14.01,13.14,14.50,14.75,14.85,15.51,14.64)  x[substr(x,4,5)>=60]<-(x[substr(x,4,5)>=60]-.60)+1  res<-sort(as.POSIXct(paste("2012-12-31", sprintf("%.2f",x),sep=" "),format="%Y-%m-%d %H.%M")) #  ifelse(format(res,"%H:%M")>=12, paste(

Re: [R] Question on creating Date variable

2012-12-31 Thread David Winsemius
On Dec 31, 2012, at 11:57 AM, David Winsemius wrote: On Dec 31, 2012, at 11:54 AM, Christofer Bogaso wrote: On 01 January 2013 01:29:53, David Winsemius wrote: On Dec 31, 2012, at 11:35 AM, Christofer Bogaso wrote: On 01 January 2013 00:17:50, David Winsemius wrote: On Dec 31, 2012, at

Re: [R] Question on creating Date variable

2012-12-31 Thread David L Carlson
Try this (assuming 14.75 is hours/decimal hours, i.e. 14:45): > x <- scan(text = "11.00 11.25 11.35 12.01 11.14 13.00 13.25 13.35 14.01 + 13.14 14.50 14.75 14.85 15.51 14.64 ") Read 15 items > x [1] 11.00 11.25 11.35 12.01 11.14 13.00 13.25 13.35 14.01 13.14 14.50 14.75 [13] 14.85 15.51 14.64 >

Re: [R] (no subject) low memory in rjava

2012-12-31 Thread eliza botto
Dear Jim, alot of love for you. i only converted .xlsx to .xls and it worked. thankyouhappy new yearkeep rocking.happy new year to all. this will be my last post of this year.thanks once again.. elisa > Date: Mon, 31 Dec 2012 15:44:31 -0500 > Subject: Re: [R] (no subject) low memory in rja

Re: [R] (no subject) low memory in rjava

2012-12-31 Thread jim holtman
One other thing to try is to convert this to an ".xls" type file. I use XLConnect a lot and have noticed that the execution times (and probably the memory usage) is greater for ".xlsx" workbooks since these are actually '.zip' files internally and therefore have all the decompression to go through

[R] Installing R-2.15.2 in Debian Wheezy/Testing

2012-12-31 Thread Stephen P. Molnar
The current version of R that is available in Wheezy is 2.15.1. However, version 2.15.2 is available at CRAN sites. The site I use is http://cran.case.edu/bin/linux/debian which states: 'If you want to have up to date R on wheezy I propose to directly install Dirks packages from unstable (sid

Re: [R] (no subject) low memory in rjava

2012-12-31 Thread eliza botto
dear steve, thanks for replying. actually i am trying to open an excel file containing 16 sheets by the following command >library(XLConnect)>sheets <- list()>for(i in 1:6) {>sheets[[i]] <- >readWorksheetFromFile("DPI.xlsx", sheet=i,region="A1:N1160")>} and all i m getting is the error i describ

Re: [R] Question on creating Date variable

2012-12-31 Thread David Winsemius
On Dec 31, 2012, at 11:54 AM, Christofer Bogaso wrote: On 01 January 2013 01:29:53, David Winsemius wrote: On Dec 31, 2012, at 11:35 AM, Christofer Bogaso wrote: On 01 January 2013 00:17:50, David Winsemius wrote: On Dec 31, 2012, at 9:12 AM, Christofer Bogaso wrote: Hello all, Let say

Re: [R] Question on creating Date variable

2012-12-31 Thread Christofer Bogaso
On 01 January 2013 01:29:53, David Winsemius wrote: On Dec 31, 2012, at 11:35 AM, Christofer Bogaso wrote: On 01 January 2013 00:17:50, David Winsemius wrote: On Dec 31, 2012, at 9:12 AM, Christofer Bogaso wrote: Hello all, Let say I have following (numeric) vector: > x [1] 11.00 11.25 1

Re: [R] Question on creating Date variable

2012-12-31 Thread David Winsemius
On Dec 31, 2012, at 11:35 AM, Christofer Bogaso wrote: On 01 January 2013 00:17:50, David Winsemius wrote: On Dec 31, 2012, at 9:12 AM, Christofer Bogaso wrote: Hello all, Let say I have following (numeric) vector: > x [1] 11.00 11.25 11.35 12.01 11.14 13.00 13.25 13.35 14.01 13.14 14.5

Re: [R] Question on creating Date variable

2012-12-31 Thread Christofer Bogaso
On 01 January 2013 00:17:50, David Winsemius wrote: On Dec 31, 2012, at 9:12 AM, Christofer Bogaso wrote: Hello all, Let say I have following (numeric) vector: > x [1] 11.00 11.25 11.35 12.01 11.14 13.00 13.25 13.35 14.01 13.14 14.50 14.75 14.85 15.51 14.64 Now, I want to create a 'Date' va

Re: [R] Question on creating Date variable

2012-12-31 Thread David Winsemius
On Dec 31, 2012, at 9:12 AM, Christofer Bogaso wrote: Hello all, Let say I have following (numeric) vector: > x [1] 11.00 11.25 11.35 12.01 11.14 13.00 13.25 13.35 14.01 13.14 14.50 14.75 14.85 15.51 14.64 Now, I want to create a 'Date' variable (i.e. I should be able to do all calculat

Re: [R] Question on creating Date variable

2012-12-31 Thread Rui Barradas
Hello, Try the following. x <- scan(text = "11.00 11.25 11.35 12.01 11.14 13.00 13.25 13.35 14.01 13.14 14.50 14.75 14.85 15.51 14.64 ") hours <- floor(x) mins <- (100*x) %% 100 as.POSIXct(paste(Sys.Date(), hours, mins), format = "%Y-%m-%d %H %M") As you can see, there are three values of

Re: [R] error when using subset (0 observations)

2012-12-31 Thread David Winsemius
On Dec 31, 2012, at 3:22 AM, Irucka Embry wrote: Hi Jorge, thank-you for the quick response. That suggestion worked perfectly. <-Original Message-> From: Jorge I Velez [jorgeivanve...@gmail.com] Sent: 12/31/2012 5:05:14 AM To: iruc...@mail2world.com Cc: r-help@r-project.org Subject

[R] Help w/ FF package to upload large file.

2012-12-31 Thread ramoss
Hello, Does anyone here know how to use this package? Documentation most confusing. I have a large CSV file w/ 6.8M obs & 19 variables. I am having memory issues trying to upload it to Green plump using: sqlSave(chann, rave, tablename="mossader_dev.rave", rownames=F, colnames=T) How can I write

Re: [R] (no subject)

2012-12-31 Thread Steve Lianoglou
Hi, Firstly -- please use an informative (non-empty!) subject line in your emails. On Mon, Dec 31, 2012 at 11:54 AM, eliza botto wrote: > > Dear useRs, > I am getting following error while using my R java machine. >>Error: OutOfMemoryError (Java): Java heap space > to get rid of it i used >>opti

[R] Question on creating Date variable

2012-12-31 Thread Christofer Bogaso
Hello all, Let say I have following (numeric) vector: > x [1] 11.00 11.25 11.35 12.01 11.14 13.00 13.25 13.35 14.01 13.14 14.50 14.75 14.85 15.51 14.64 Now, I want to create a 'Date' variable (i.e. I should be able to do all calculations pertaining to date/time and also time-series plotting

[R] (no subject)

2012-12-31 Thread eliza botto
Dear useRs, I am getting following error while using my R java machine. >Error: OutOfMemoryError (Java): Java heap space to get rid of it i used >options( java.parameters = "-Xmx1200m") but unfortunatly its not working Does anyone ever encountered this error?? thanks in advance... elisa

Re: [R] a problem for metafor package

2012-12-31 Thread Viechtbauer Wolfgang (STAT)
Dear Xudong, First of all, most attachments are stripped on r-help -- yours didn't make it through either. Since you sent a separate e-mail to me personally (including the attachment), I can see what you want to accomplish, but let's keep this on the list. Second, your mail to r-help contained

Re: [R] a problem for metafor package

2012-12-31 Thread John Kane
The attachement did not come through and we need some idea of what you are doing. Please see https://github.com/hadley/devtools/wiki/Reproducibility for some ideas of what we need. And please read the posting guide John Kane Kingston ON Canada > -Original Message- > From: idliuxud.

Re: [R] help with reshaping wide to long format

2012-12-31 Thread usha2013
Hi Arun Thanks for the answer.1) I was not aware of the "tail" function. 2)Regarding the 2nd question answer, I am trying to understand the BP.stacknormal$Categ<-"Normal" BP.stackObese$Categ<-"Obese" what does the"category" imply? Also, when we bind two subsets(rbind), the result of regression

Re: [R] help with reshaping wide to long format

2012-12-31 Thread arun
HI Usha, For your first question (saw ur posting in Nabble). I subset the data on the reshaped long format data which has time variable.  Please check my previous email. BP.stacknormal<-subset(BP.stack3,Obese==0 & Overweight==0) ^^^ The variable "Cate

Re: [R] code to convert 3D geographical coordinates to Cartesian?

2012-12-31 Thread Tom Roche
summary: I'm looking for packaged, tested code to convert geographical coordinates (e.g., longitude, latitude, elevation) to Cartesian coordinates (x,y,z) in 3-space. I know of R code for 2-space and for spherical <-> Cartesian. This can be extended (I attach a quick kludge extending pracma::sph2c

[R] a problem for metafor package

2012-12-31 Thread LiuXudong
Dear sir or madam I want to know how to use "metafor"package do a meta anlysis, forest plot show the results of whole study and results of two subgroups like this the forest plot show in the attachment. looking forword to your reply Regards and Cheers Xudong Liu School of Public

Re: [R] group values in classes

2012-12-31 Thread Neal H. Walfield
At Mon, 31 Dec 2012 12:13:43 +0200, catalin roibu wrote: > > Dear R users, > I want to group numerical values in classes with different size and count > the values for each classes. > > My data is in this forma: > d 15 12,5 30,4 20,5 80,4 100,5 8,2 40,5 33 21 11 > And I want the group

Re: [R] group values in classes

2012-12-31 Thread Rui Barradas
Hello, Try the following. classes <- function(x, n){ n*findInterval(x, seq(0, ceiling(max(x)), by = n)) } c4 <- classes(d, 4) table(c4) sum(table(c4)) Happy new year, Rui Barradas Em 31-12-2012 10:13, catalin roibu escreveu: Dear R users, I want to group numerical values in classes wit

Re: [R] error when using subset (0 observations)

2012-12-31 Thread Irucka Embry
Hi Jorge, thank-you for the quick response. That suggestion worked perfectly. Have a Happy New Year too! Irucka Embry <-Original Message-> >From: Jorge I Velez [jorgeivanve...@gmail.com] >Sent: 12/31/2012 5:05:14 AM >To: iruc...@mail2world.com >Cc: r-help@r-project.org >Subject: Re: [R

[R] I need intercept in plm model

2012-12-31 Thread Millo Giovanni
Dear Matteo, a fixed effects (within) model does not have a single intercept: it has N. I suggest you have another look at FE models' theory. Some confusion often stems from Stata (misleadingly, IMHO) reporting an "intercept" which is actually the average of the individual intercepts, which you

[R] error when using subset (0 observations)

2012-12-31 Thread Irucka Embry
Hi, how are you? My name is Irucka Embry and I would like assistance on properly subsetting some data obtained from a .csv file. > file <-"info_n.csv" > INFO<- getMetaDataFromFile(file) INFO is 92 observations of 14 variables > INFO<- subset(INFO,site.no==02169570) INFO is 0 observations of 14

Re: [R] How to multiple the vector and variables from dataframe

2012-12-31 Thread Berend Hasselman
On 31-12-2012, at 03:24, meng wrote: > > I type: > dat*rep(z,rach=nrow(dat)) > "rach" is "each" indeed,but I type "rach" mistakenly. > What's strange to me is :No error reply appears,but show me the result: >> dat*rep(z,rach=nrow(dat)) > x1x2x3 > 1 0.1 0.4 0.7 > 2 20.0 50.0

[R] group values in classes

2012-12-31 Thread catalin roibu
Dear R users, I want to group numerical values in classes with different size and count the values for each classes. My data is in this forma: d 15 12,5 30,4 20,5 80,4 100,5 8,2 40,5 33 21 11 And I want the group them in classes with 4 (5,etc) cm size like this: class d 16 16 3

Re: [R] efficiently multiply different matrices in 3-d array with different vectors?

2012-12-31 Thread Suzen, Mehmet
On 30 December 2012 20:21, arun wrote: > HI, > I was not aware of the algebraic relationship. > Tx for the explanation. For the record; the simple example I have shown can be reproduced with Einstein's summation rule as well. While A and x tensors have covariant (lower) indices *only*. So using %

Re: [R] code to convert 3D geographical coordinates to Cartesian?

2012-12-31 Thread David Winsemius
On Dec 30, 2012, at 8:14 PM, Tom Roche wrote: https://stat.ethz.ch/pipermail/r-help/2012-December/332658.html Is there packaged code to convert geographical coordinates (e.g., longitude, latitude, elevation) to Cartesian coordinates in 3-space? ... Net: the task seems straightforward enough

Re: [R] How to multiple the vector and variables from dataframe

2012-12-31 Thread arun
HI Meng, Just try: rep(z,rach=nrow(dat)) #[1]   0.1  10.0 100.0  rep(z,chair=nrow(dat)) #[1]   0.1  10.0 100.0 rep(z,times=nrow(dat)) #[1]   0.1  10.0 100.0   0.1  10.0 100.0   0.1  10.0 100.0  rep(z,each=nrow(dat)) #[1]   0.1   0.1   0.1  10.0  10.0  10.0 100.0 100.0 100.0  rep(z,nrow(dat)) #[1]

Re: [R] How to multiple the vector and variables from dataframe

2012-12-31 Thread meng
Ok,I'll follow your suggestion. Thanks! At 2012-12-31 11:20:17,arun wrote: >HI Meng, > > >Just try: >rep(z,rach=nrow(dat)) >#[1] 0.1 10.0 100.0 > rep(z,chair=nrow(dat)) >#[1] 0.1 10.0 100.0 >rep(z,times=nrow(dat)) >#[1] 0.1 10.0 100.0 0.1 10.0 100.0 0.1 10.0 100.0 > rep(z,eac