[R] RWeka - weighted instances

2012-12-04 Thread Francisco Javier Perez Caballero
Is there any way to train Weka classifiers using weighted instances in RWeka? I have done it in Weka in Java, but I don't see any way to pass the weights to the classifier in the RWeka documentation. Thanks __ R-help@r-project.org mailing list https://s

Re: [R] Import multiple data frames and combine them using "cbind"

2012-12-04 Thread Gyanendra Pokharel
Thanks Dennis, Your code also produces same as Jim's but I am not looking that one, I need to use "cbind" so that finally I will get the data frame of size 200X320 (i,e, 200 X(16X20)). Thanks On Tue, Dec 4, 2012 at 10:46 PM, Dennis Murphy wrote: > In addition to Jim's reply, had you used the pl

[R] nlme starting values are not the correct length

2012-12-04 Thread Lara Reichmann
Dear R community, I am trying to fit an nlme model where I want to estimate the fixed effects of two treatments on the parameters on the following equation Photo~(a*(1-exp(-c*PARi/a)))-b I was able to fit a simple model without covariates following the method described in Mixed-Effects Methods

Re: [R] list to matrix?

2012-12-04 Thread arun
Hi,  p <- lapply(1:1e6, function(i)c(i, log2(i)))  system.time(z1 <- t(sapply(p,function(x)x))) #   user  system elapsed  # 2.568   0.048   2.619  system.time(z1 <- do.call(rbind,p)) #   user  system elapsed  # 4.000   0.052   4.060 A.K. - Original Message - From: William Dunlap

[R] bigglm (but not glm) error with poisson distribution

2012-12-04 Thread Miki Bálint
Dear All, I am trying to fit a generalized linear model with bigglm() (v. 0.8) on a large dataset containing many zeros under a poisson distribution (in R 2.15.0, 64 bit Ubuntu 12.04). The bigglm() call gives an error message (NA/NaN/Inf in foreign function call (arg 3)). If I understand correctly

Re: [R] partial analisys of a time series

2012-12-04 Thread arun
Hi, In addition, you can also subset using: births <- scan("http://robjhyndman.com/tsdldata/data/nybirths.dat";) birthstimeseries <- ts(births, frequency=12, start=c(1946,1)) library(xts) birthstimeseriesxts<-as.xts(birthstimeseries) birthstsJanFeb<-birthstimeseriesxts[format(time(birthstimeserie

Re: [R] Labelling x axis in plot function

2012-12-04 Thread Jim Lemon
On 12/05/2012 04:24 AM, T Bal wrote: Hi, In the plot function I want to label x axis as the numbers between 1 and 12 (so 1, 2, 3, 4, 5, ..., 12). How should I do it? The range of x values are different than this range. Thanks! Hi T Bal, You are probably troubled by missing labels. Try the staxl

Re: [R] Help for a function

2012-12-04 Thread Jim Lemon
On 12/05/2012 01:01 AM, anoumou wrote: Hello all, I need a help. I am modeling a disease and a create a R function like that: ... But i do not get the results,i try by all means but i d'ont understant the problem. Hi anoumou, Your function provides almost no indication of what two of its five

Re: [R] Import multiple data frames and combine them using "cbind"

2012-12-04 Thread Gyanendra Pokharel
Thanks Jim but I need to use "cbind" otherwise I will not get the correct information from the data. Also each data set has the dimension 200X365 but I only need 200X20 each. Thanks On Tue, Dec 4, 2012 at 10:22 PM, jim holtman wrote: > try:: > > do.call(rbind, myfiles) > > On Tue, Dec 4, 2012 a

Re: [R] Import multiple data frames and combine them using "cbind"

2012-12-04 Thread jim holtman
try:: do.call(rbind, myfiles) On Tue, Dec 4, 2012 at 9:37 PM, Gyanendra Pokharel wrote: > Hi group, > > I imported 16 data frames using the function "list.files" > > temp <- list.files(path="...") > myfiles = lapply(temp, read.table,sep = "") > > Now I have 16 data set imported in R win

Re: [R] Problems with weight

2012-12-04 Thread Thomas Lumley
You need to defined a svydesign object that contains all the variables you want to use. This object is passed as the design= argument to all the analysis functions in the survey package. The functions don't have a data= argument, and many of them will not look outside the design= argument for var

[R] Import multiple data frames and combine them using "cbind"

2012-12-04 Thread Gyanendra Pokharel
Hi group, I imported 16 data frames using the function "list.files" temp <- list.files(path="...") myfiles = lapply(temp, read.table,sep = "") Now I have 16 data set imported in R window. I want to combine them by row and tried some thing like (Here I am considering only 20 columns) f

Re: [R] control point size of superscript when labeling axes with title()

2012-12-04 Thread Chris Solomon
Fantastic - that does the trick, David, thanks for setting me straight! Chris -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Tuesday, December 04, 2012 8:19 PM To: Chris Solomon Cc: r-help@r-project.org Subject: Re: [R] control point size of superscript wh

Re: [R] How to find matching columns in a matrix of lists?

2012-12-04 Thread Asis Hallab
Hi R users following this thread! I evaluated both solutions given by Rui and Arun. Both work very well. Arun's is a little faster. I did the following time measurements on a large matrix with 2 rows, labelled "InterPro" and "GO", and 88664 columns, labelled with protein IDs. I was interested in

Re: [R] control point size of superscript when labeling axes with title()

2012-12-04 Thread David Winsemius
On Dec 4, 2012, at 11:05 AM, Chris Solomon wrote: > Hi- > > A journal has asked me to make all of my text annotations on a figure at > 10-point size. For the most part this is easy, e.g. by creating figures with: > pdf(..., family='Times', pointsize=10) > > But where I have superscripts (or

Re: [R] partial analisys of a time series

2012-12-04 Thread Antonio Silva
Hi all Thanks for the attention and answers. I learned a lot I now I can go on my work. I also tryed to you de command window(). I thought it would be possible to select one column of an ts object, like we can do with a data.frame (plot(data[,2],data[,3]), to work. But as I saw we need to extract

Re: [R] list to matrix?

2012-12-04 Thread William Dunlap
> No need for all this (see solutions including mine already given) -- > but even without those, this is silly. An identity map is a real waste > if you just want the simplification bit of sapply() -- you'd be much > better just using simplify2array() You are right that simplify2array(p) does ever

[R] latticeExtra tileplot question - tiles are not all the same size, need help.

2012-12-04 Thread Ryan Flaherty
Hello, I have been creating many tileplots to try and illustrate the relative abundance of fish through space and time. My issue is that the tiles that border the plot are smaller than those in the center of the plot. In the example I've provided the effect is pretty minor (I'm hoping this will be

Re: [R] list to matrix?

2012-12-04 Thread R. Michael Weylandt
On Tue, Dec 4, 2012 at 8:17 PM, arun wrote: > Hi, > Try this: > list1<-list(c(5, 101), c(1e+05, 46), c(15, 31), c(2e+05, 17), > c(25, 19), c(3e+05, 11), c(35, 12), c(4e+05, 25), > c(45, 19), c(5e+05, 16)) > > > res<-t(sapply(list1,function(x) x)) Bah Humbug! (In Christ

Re: [R] How to find matching columns in a matrix of lists?

2012-12-04 Thread Rui Barradas
Hello, Try the following. m[ , sapply(1:ncol(m), function(j) sapply("B", `%in%`, m[[1 , j]])), drop=F ] Hope this helps, Rui Barradas Em 04-12-2012 21:16, Asis Hallab escreveu: Dear R users, I have a matrix composed of lists: m <- matrix( list(), nrow=1, ncol=3 ) m[[ 1, 1 ]] <- list("A",

Re: [R] How to find matching columns in a matrix of lists?

2012-12-04 Thread arun
HI, Does this work for you?  mapply(function(x) x=="B",m)   [,1]  [,2]  [,3] #[1,] FALSE FALSE FALSE #[2,]  TRUE FALSE  TRUE A.K. - Original Message - From: Asis Hallab To: r-help@r-project.org Cc: Sent: Tuesday, December 4, 2012 4:16 PM Subject: [R] How to find matching columns

Re: [R] reformatting some data

2012-12-04 Thread arun
Hi, You can also do this: dat1<-structure(list(group = c(4L, 3L, 4L, 4L, 4L, 2L), X3.Hydroxybutyrate =  c(4e-04,  5e-04, 4e-04, 6e-04, 5e-04, 7e-04), X3.Hydroxyisovalerate = c(3e-04,  3e-04, 3e-04, 3e-04, 3e-04, 4e-04), ADP = c(5e-04, 6e-04, 6e-04,  5e-04, 7e-04, 7e-04)), .Names = c("group", "X3.Hy

Re: [R] reformatting some data

2012-12-04 Thread arun
Hi, Not sure whether this helps: library(reshape2) dat1<-structure(list(group = c(4L, 3L, 4L, 4L, 4L, 2L), X3.Hydroxybutyrate =  c(4e-04,  5e-04, 4e-04, 6e-04, 5e-04, 7e-04), X3.Hydroxyisovalerate = c(3e-04,  3e-04, 3e-04, 3e-04, 3e-04, 4e-04), ADP = c(5e-04, 6e-04, 6e-04,  5e-04, 7e-04, 7e-04)),

Re: [R] How to find matching columns in a matrix of lists?

2012-12-04 Thread Asis Hallab
Hello, m[ , sapply(1:ncol(m), function(j) sapply("B", `%in%`, m[[1 , j]])), drop=F > ] > It indeed does. Thank you very much! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-he

[R] How do I get internal nodes of dendograms produced by R?

2012-12-04 Thread sagnik ray choudhury
I am using R for hierarchical clustering of a number of documents. I have a distance matrix on which I have applied hclust method. When I plot the result of hclust method, I can see the dendogram plotted. What I need now is the dendogram stored as a tree in a data structure. My goal is to automati

Re: [R] list to matrix?

2012-12-04 Thread arun
Hi, Try this: list1<-list(c(5, 101), c(1e+05, 46), c(15, 31), c(2e+05, 17),     c(25, 19), c(3e+05, 11), c(35, 12), c(4e+05, 25),     c(45, 19), c(5e+05, 16)) res<-t(sapply(list1,function(x) x)) res #    [,1] [,2]  #[1,]  5  101  #[2,] 10   46  #[3,] 15   31

Re: [R] computing marginal values based on multiple columns?

2012-12-04 Thread Simon
Thanks to both of you! I learned something new from both of your posts :-) And you were both right, my example numbers were wrong! I accidentally computed them based on 0.25 * mean instead of 0.2 * mean. Thanks again! Simon On Wed, Dec 5, 2012 at 4:07 AM, arun wrote: > HI, > > I am not sure t

Re: [R] Large loops in R

2012-12-04 Thread arun
HI, I just wonder whether your code worked or not. set.seed(8) mat1<-matrix(sample(1:80,40,replace=TRUE),ncol=8) set.seed(25) mat2<-matrix(sample(1:160,40,replace=TRUE),ncol=8) #Since the dimensions are the same, m<-1:5 n<-1:8 sum1<-0 for(i in 1:length(m)){  for(j in 1:length(n)){  sum1<-sum1+

Re: [R] monte carlo simulation on R

2012-12-04 Thread Suzen, Mehmet
There is a book on MC with R: Introducing Monte Carlo Methods with R by Robert/Casella: http://www.springer.com/statistics/computational+statistics/book/978-1-4419-1575-7 On 4 December 2012 19:38, R. Michael Weylandt wrote: > replicate(1000, sum(rnorm(50)^2-rchisq(50, 3))) > > Or you know, many

Re: [R] reformatting some data

2012-12-04 Thread Mark Lamias
That should read the "reshape" package -- not the "shape" package.  My apologies. To: Charles Determan Jr ; "r-help@r-project.org" Sent: Tuesday, December 4, 2012 4:36 PM Subject: Re: [R] reformatting some data It's not clear to me what it is you are att

Re: [R] reformatting some data

2012-12-04 Thread Mark Lamias
It's not clear to me what it is you are attempting to do, as you switch from a very specific example to some general example with the vague terms "var1" "var2", and "var3." It sounds like you might be trying to do something similar to what would be available in the shape package using the melt

[R] reformatting some data

2012-12-04 Thread Charles Determan Jr
Hello, I am trying to reformat some data so that it is organized by group in the columns. The data currently looks like this: group X3.Hydroxybutyrate X3.Hydroxyisovalerate ADP 347 4 4e-04 3e-04 5e-04 353 3 5e-04

[R] How to find matching columns in a matrix of lists?

2012-12-04 Thread Asis Hallab
Dear R users, I have a matrix composed of lists: m <- matrix( list(), nrow=1, ncol=3 ) m[[ 1, 1 ]] <- list("A", "B") m[[ 1, 2 ]] <- list("A", "C") m[[ 1, 3 ]] <- list("A", "B") and want to get the sub-matrix where cells contain "B". But m[ , "B" %in% m[ 1, ], drop=F ] as well as m[ , "B" %in%

Re: [R] Large loops in R

2012-12-04 Thread Sarah Goslee
I don't think there's any reason for the calculation you're doing that you must have the whole matrix in memory, is there? Unless there's something more than what you've shown us, you're just taking the sum of elementwise operations. You can read the matrix in in manageable chunks, take the sum of

Re: [R] Large loops in R

2012-12-04 Thread R. Michael Weylandt
On Tue, Dec 4, 2012 at 8:14 PM, Charles Novaes de Santana wrote: > "Error in matrix(0, 48000, 48000) : too many elements specified" > > but I thought it was a machine limitation (and I was asking for access > to a better machine in my labs...). Thanks for clarifying it. > > Well, when Sarah gave m

Re: [R] Large loops in R

2012-12-04 Thread Charles Novaes de Santana
Thank you, Sarah! It is a wonderful new!!! :) Now I need to solve the other question hehe How to allocate such large matrix :) best, Charles On Tue, Dec 4, 2012 at 8:39 PM, Sarah Goslee wrote: > Without a reproducible example it's hard to tell for certain, but what > about simply (assuming nro

Re: [R] list to matrix?

2012-12-04 Thread R. Michael Weylandt
On Tue, Dec 4, 2012 at 8:09 PM, Sam Steingold wrote: > How do I convert a list to a matrix? > > --8<---cut here---start->8--- > list(c(5, 101), c(1e+05, 46), c(15, 31), c(2e+05, 17), > c(25, 19), c(3e+05, 11), c(35, 12), c(4e+05, 25), > c

Re: [R] list to matrix?

2012-12-04 Thread Mark Lamias
Try: matrix(unlist(a), ncol=2, byrow=T) --Mark Lamias From: Sam Steingold To: r-help@r-project.org Sent: Tuesday, December 4, 2012 3:09 PM Subject: [R] list to matrix? How do I convert a list to a matrix? --8<---cut here---start---

Re: [R] Large loops in R

2012-12-04 Thread Charles Novaes de Santana
On Tue, Dec 4, 2012 at 8:43 PM, Peter Langfelder wrote: > On Tue, Dec 4, 2012 at 11:27 AM, Charles Novaes de Santana > wrote: >> Dear Michael, >> >> Thank you for your answer. >> >> I have 2 matrices. Each position of the matrices is a weight. And I >> need to calculate the following sum of diffe

Re: [R] monte carlo simulation on R

2012-12-04 Thread Suzen, Mehmet
There is a book on MC with R: Introducing Monte Carlo Methods with R by Robert/Casella: http://www.springer.com/statistics/computational+statistics/book/978-1-4419-1575-7 On 4 December 2012 19:21, Adel ESSAFI wrote: > Hello, > > How can I make a monte carlo simulation on R? > > Regards > Adel >

[R] list to matrix?

2012-12-04 Thread Sam Steingold
How do I convert a list to a matrix? --8<---cut here---start->8--- list(c(5, 101), c(1e+05, 46), c(15, 31), c(2e+05, 17), c(25, 19), c(3e+05, 11), c(35, 12), c(4e+05, 25), c(45, 19), c(5e+05, 16)) as.matrix(a) [,1] [1,]

Re: [R] Large loops in R

2012-12-04 Thread Peter Langfelder
On Tue, Dec 4, 2012 at 11:27 AM, Charles Novaes de Santana wrote: > Dear Michael, > > Thank you for your answer. > > I have 2 matrices. Each position of the matrices is a weight. And I > need to calculate the following sum of differences: > > Considering: > mat1 and mat2 - two matrices (each of th

Re: [R] Large loops in R

2012-12-04 Thread Sarah Goslee
Without a reproducible example it's hard to tell for certain, but what about simply (assuming nrows2 is actually columns): sum((mat1/d1 - mat2/d2)^2) R is smart enough to understand elementwise manipulation of a matrix: you shouldn't need a loop at all. Sarah On Tue, Dec 4, 2012 at 2:27 PM, Cha

Re: [R] Large loops in R

2012-12-04 Thread Charles Novaes de Santana
Dear Michael, Thank you for your answer. I have 2 matrices. Each position of the matrices is a weight. And I need to calculate the following sum of differences: Considering: mat1 and mat2 - two matrices (each of them 48000 x 48000). d1 and d2 - two constant values. sum<-0; for(i in 1:nrows1){

[R] control point size of superscript when labeling axes with title()

2012-12-04 Thread Chris Solomon
Hi- A journal has asked me to make all of my text annotations on a figure at 10-point size. For the most part this is easy, e.g. by creating figures with: pdf(..., family='Times', pointsize=10) But where I have superscripts (or subscripts) in axis labels, the default seems to be to shrink th

Re: [R] Large loops in R

2012-12-04 Thread R. Michael Weylandt
On Dec 4, 2012, at 6:47 PM, Charles Novaes de Santana wrote: > Dear all, > > I need to access data from a large matrix (48000 x 48000) and to do it > I am trying to run two loops using "for" command. Surely it is been a > very slow job. > > I heard that "for" is not the best option to perfor

[R] Large loops in R

2012-12-04 Thread Charles Novaes de Santana
Dear all, I need to access data from a large matrix (48000 x 48000) and to do it I am trying to run two loops using "for" command. Surely it is been a very slow job. I heard that "for" is not the best option to perform large loops in R, but I don't really know what would be the best (fast) option

Re: [R] Winbugs from R

2012-12-04 Thread Bob O'Hara
This is a BUGS problem, not an R problem, so would be better asked on the BUGS list (a practical hint: if it's not working through R, run the code directly in BUGS: the error reporting is better). Anyway, here BUGS manages to tell R to tell you what's wrong: variable n is not defined And looking

Re: [R] monte carlo simulation on R

2012-12-04 Thread R. Michael Weylandt
replicate(1000, sum(rnorm(50)^2-rchisq(50, 3))) Or you know, many other things... Michael On Tuesday, December 4, 2012, Adel ESSAFI wrote: > Hello, > > How can I make a monte carlo simulation on R? > > Regards > Adel > > > -- > PhD candidate in Computer Science > Address > 3 avenue lamine, cité

Re: [R] odd behavior of browser()

2012-12-04 Thread Duncan Murdoch
On 04/12/2012 12:54 PM, David Romano wrote: Hi everyone, I normally include a call to browser() as I'm working out the kinks in my scripts, and I am always able to step through each line by hitting "Return", but for some reason, in the scripts I'm working on now, hitting "Return" seems to cause

[R] monte carlo simulation on R

2012-12-04 Thread Adel ESSAFI
Hello, How can I make a monte carlo simulation on R? Regards Adel -- PhD candidate in Computer Science Address 3 avenue lamine, cité ezzahra, Sousse 4000 Tunisia tel: +216 97 246 706 (+33640302046 jusqu'au 15/6) fax: +216 71 391 166 [[alternative HTML version deleted]] __

Re: [R] Read.csv

2012-12-04 Thread Sarah Goslee
Hi Arvin, How are you preparing the data to be read: a spreadsheet? How are you reading the data? How have you verified that the CSV file is correct? How have you verified that the data frame is incorrect? Can you provide a reproducible example using a small portion of your dataset? Sarah On T

Re: [R] Read.csv

2012-12-04 Thread Duncan Murdoch
On 04/12/2012 1:02 PM, Torus Insurance wrote: Hi list, I am using read.csv to read data from csf files, but noticed that the numeric data (those larger than 10 power 9) are rounded to the nearest million (10 power 6). Any solution? What makes you think that is happening? R rounds values for pr

[R] Read.csv

2012-12-04 Thread Torus Insurance
Hi list, I am using read.csv to read data from csf files, but noticed that the numeric data (those larger than 10 power 9) are rounded to the nearest million (10 power 6). Any solution? Thanks Arvin -- Sent from my mobile device __ R-help@r-project.org

Re: [R] odd behavior of browser()

2012-12-04 Thread R. Michael Weylandt
Untested, I think it's the blank line in your script which exits the debugger and then you're seeing regular execution. MW On Tue, Dec 4, 2012 at 5:54 PM, David Romano wrote: > Hi everyone, > > I normally include a call to browser() as I'm working out the kinks in my > scripts, and I am always a

[R] error reading xlsm file with read.xls

2012-12-04 Thread Sebastian Kruk
Dear all, I cannot reading a .xlsm file using read.xls. I executed: read.xls("resultados.xlsm", colNames = TRUE, sheet = 1, type = "data.frame", from = 1, rowNames = NA, colClasses = "character", checkNames = TRUE, dateTime = "numeric", naStrings = NA, stringsAsFactors = F) Error: Call("ReadXls

Re: [R] Solve system of equations (nleqslv) only returns origin

2012-12-04 Thread Berend Hasselman
On 04-12-2012, at 18:50, Berend Hasselman wrote: > > > You should return the vector y i.e. function values. > But y has length 4 and x has length 4. > x has length 5 of course. Berend > So where is the fifth value for y? > >> } >> >> Xstart=c(1, 200, 0.5, 0.5, 12) >> fstart= firstor

[R] odd behavior of browser()

2012-12-04 Thread David Romano
Hi everyone, I normally include a call to browser() as I'm working out the kinks in my scripts, and I am always able to step through each line by hitting "Return", but for some reason, in the scripts I'm working on now, hitting "Return" seems to cause execution of *all* the lines in my script. I'

Re: [R] Solve system of equations (nleqslv) only returns origin

2012-12-04 Thread Berend Hasselman
On 04-12-2012, at 17:06, Alicia Ellis wrote: > I'm solving 4 complex equations simultaneously. Code is below. The code > returns only zero's for the solution though there should also be a non-zero > result. I'm pretty confident that the equations are correct because they > are straight from a

Re: [R] Labelling x axis in plot function

2012-12-04 Thread Rui Barradas
Hello, You should provide sample data and code. plot(3:10, xlim = c(0, 12), xaxt = "n") axis(1, at = 1:12) See the help page ?par for a description of the graphical parameters 'xlim' and 'xaxt', and of ?axis. Hope this helps, Rui Barradas Em 04-12-2012 17:24, T Bal escreveu: Hi, In the pl

[R] Labelling x axis in plot function

2012-12-04 Thread T Bal
Hi, In the plot function I want to label x axis as the numbers between 1 and 12 (so 1, 2, 3, 4, 5, ..., 12). How should I do it? The range of x values are different than this range. Thanks! Kind regards, T. Bal [[alternative HTML version deleted]] ___

Re: [R] Help for a function

2012-12-04 Thread Jeremy Miles
What are you expecting? What do you get? What is the problem? J On 4 December 2012 06:01, anoumou wrote: > Hello all, > I need a help. > I am modeling a disease and a create a R function like that: > > Lambda<-function (x,date1,r,h,a){ > ndate1 <- as.Date(date1, "%d/%m/%Y") > t1 <- as.nume

Re: [R] computing marginal values based on multiple columns?

2012-12-04 Thread arun
HI, I am not sure the output you wanted is correct: " sample1 sample2 sample3 1      1.0    0    0.5 " because 0.2*colMeans(x[,-4]) sample1 sample2 sample3 #  28.40   24.08   21.36 This might help you: apply(x[-4],2,function(y) length(y[y <0.2*mean(y) & x$class=="a"])/length(x[x$class=="

Re: [R] lme: subject-specific slopes.

2012-12-04 Thread Brian S Cade
John: I think you want the output from coef(fitRIRT). The ranef(fitRIRT) will give you the subject specific random effect deviations from the fixed effects means. The coef(fitRIRT) will give you the combination of the fixed effect means with the subject specific random effect deviations and

[R] Solve system of equations (nleqslv) only returns origin

2012-12-04 Thread Alicia Ellis
I'm solving 4 complex equations simultaneously. Code is below. The code returns only zero's for the solution though there should also be a non-zero result. I'm pretty confident that the equations are correct because they are straight from a published paper and I checked them pretty thoroughly. T

[R] How to reset R settings to original state other than remove .Rdata and .Rhistory

2012-12-04 Thread Tian3507
Dear all, Do you know how to return all the R settings to original state? Other than .Rdata and .Rhistory Some weid thing happened to my machine. I was trying to get shaded confidence band ploted using survplot from rms liberary. It worked on one machine, but not on the other. I tried unsta

Re: [R] lme: subject-specific slopes.

2012-12-04 Thread John Sorkin
Yes, you are correct. Thanks, John John David Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605

Re: [R] lme: subject-specific slopes.

2012-12-04 Thread Kenneth Frost
I think the random effects represent the subject adjustments to the population averages. You may have to do the addition yourself to get the subject specific slopes and intercepts. Someone will hopefully correct me if I'm wrong. On 12/04/12, John Sorkin wrote: > > > > Ken, > Thank you for yo

Re: [R] lme: subject-specific slopes.

2012-12-04 Thread John Sorkin
Ken, Thank you for your help. ranef(fitRIRT) does not give me what I expect. The subject-specific slopes, and subject-specific intercepts are not anywhere close to what I would expect them to be; the mean of the subject-specfic values should be close to those reported by summary(fitRIRT) and th

[R] lme: subject-specific slopes.

2012-12-04 Thread John Sorkin
I am running a random intercept random slope regression: fitRIRT <- lme(echogen~time,random=~ 1+time|subject,data=repeatdata,na.action=na.omit) summary(fitRIRT) I would like to get the subject-specific slopes, i.e. the slope that the model computes for each subject. If I have 10-subjects I s

Re: [R] model selection with spg and AIC (or, convert list to fitted model object)

2012-12-04 Thread Ravi Varadhan
Adam, Getting the variance of MLE estimator when the true parameter is on the boundary is a very difficult problem. It is known that the standard bootstrap does not work. There are some sub-sampling approaches (Springer book: Politis, Romano, Wolff), but I am not an expert on this. However,

[R] Spatial AND Temporal Dependency with lme, or other function?

2012-12-04 Thread Anne-Sophie Julien
Hi, I've got a new dataset which I don't know how to analyze with R. My knowledge about R is limited for this kind of problem. I've tried to find a solution with some spatio temporel packages and lme/lmer functions, but didn't find any similar example. I've got 10 locations on a coast on which

Re: [R] Histogram plot help

2012-12-04 Thread YAddo
Thanks, Rui and David! -- View this message in context: http://r.789695.n4.nabble.com/Histogram-plot-help-tp4651958p4652065.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailma

Re: [R] Different results from random.Forest with test option and using predict function

2012-12-04 Thread Liaw, Andy
Without data to reproduce what you saw, we can only guess. One possibility is due to tie-breaking. There are several places where ties can occur and are broken at random, including at the prediction step. One difference between the two ways of doing prediction is that when it's all done withi

Re: [R] partial analisys of a time series

2012-12-04 Thread arun
Hi, If the frequency is >1, the error message will  be gone. For e.g. birthstimeseriesJanFeb<-subset(birthstimeseries,cycle(birthstimeseries)==c(1,2))  birthstimeseriesJanFeb1<-ts(birthstimeseriesJanFeb,frequency=2,start=c(1946,1))  plot.ts(birthstimeseriesJanFeb1)  birthstimeseriesJanFebHW<-HoltWi

Re: [R] do.call

2012-12-04 Thread arun
Hi, Try this: set.seed(15) datos<-as.data.frame(matrix(sample(c(1:20,NA),30,replace=TRUE),ncol=6))  do.call(paste,c(na.omit(datos),sep=";")) #[1] "5;18;14;10;17;3"  "14;15;15;3;2;20"  "8;18;19;17;12;11" A.K. - Original Message - From: Dominic Roye To: r-help@r-project.org Cc: Sent: Tu

Re: [R] partial analisys of a time series

2012-12-04 Thread arun
HI, I am getting an error message: l.blist<-lapply(blist,HoltWinters) #Error in decompose(ts(x[1L:wind], start = start(x), frequency = f), seasonal) :  # time series has no or less than 2 periods A.K. - Original Message - From: PIKAL Petr To: Antonio Silva ; "R-help@r-project.org" C

Re: [R] help with if statement

2012-12-04 Thread anto.r
DT<-data.frame(time=c(0,1,5,24,36,48,72),DV=seq(0,60,10)) time DV 10 0 21 10 35 20 4 48 30 5 84 40 6 96 50 7 120 60 You want to add 24 to values that are >=24 in 'time' DT[DT$time>=24,'time']<-DT[DT$time>=24,'time']+24 time DV 10 0 21 10 35 20 4 48 30 5 60

Re: [R] r function definition

2012-12-04 Thread FJ M
Are you using windows? If you are you may want to try to run your R code from a batch file: REM on Microsoft Windows (adjust the path to R.exe as needed) "C:\Program Files\R\R-2.13.2\bin\x64\R.exe" CMD BATCH "C:\Users\Frank\Documents\R\Projects\Heinrich\Heinrich.txt" "C:\Users\Frank\Documen

[R] Help for a function

2012-12-04 Thread anoumou
Hello all, I need a help. I am modeling a disease and a create a R function like that: Lambda<-function (x,date1,r,h,a){ ndate1 <- as.Date(date1, "%d/%m/%Y") t1 <- as.numeric(ndate1) x[order(x$i),] t <-x[,"t"] i <-x[,"i"] CONTAGIEUX <-x[,"CONTAGIEUX"] while ( t1 < min(t) ){ for (i

[R] Winbugs from R

2012-12-04 Thread Günal Bilek
Hi, I am trying to covert a Winbugs code into R code. Here is the winbugs code model{# model’s likelihoodfor (i in 1:n){time[i] ~ dnorm( mu[i], tau ) # stochastic componenent# link and linear predictormu[i] <- beta0 + beta1 * cases[i] + beta2 * distance[i]}# prior distributionstau ~ dgamma( 0.01

Re: [R] Subsetting columns in data.table

2012-12-04 Thread anto.r
DT = data.frame(x=rep(c("a","b","c"),each=3), y=c(1,3,6), v=1:9, w=3:11, z=LETTERS[1:9]) If I understand you right, and you want to select all rows where v>3 and W<10 with(DT, DT[which(v>3 & w<10),]) x y v w z 4 b 1 4 6 D 5 b 3 5 7 E 6 b 6 6 8 F 7 c 1 7 9 G you can use colSums, rowSums on th

Re: [R] julia language unfair comparisons against R

2012-12-04 Thread R. Michael Weylandt
There been, that done. http://stackoverflow.com/questions/9968578/speeding-up-julias-poorly-written-r-examples/10712158#10712158 MW On Tue, Dec 4, 2012 at 2:34 PM, Suzen, Mehmet wrote: > Hello List, > > Probably many of you aware of the Julia language > (http://julialang.org/), It is a promisin

Re: [R] How do I make R randomForest model size smaller?

2012-12-04 Thread Liaw, Andy
Try the following: set.seed(100) rf1 <- randomForest(Species ~ ., data=iris) set.seed(100) rf2 <- randomForest(iris[1:4], iris$Species) object.size(rf1) object.size(rf2) str(rf1) str(rf2) You can try it on your own data. That should give you some hints about why the formula interface should be

[R] julia language unfair comparisons against R

2012-12-04 Thread Suzen, Mehmet
Hello List, Probably many of you aware of the Julia language (http://julialang.org/), It is a promising project. However it seems like R is very slow in their benchmarks. Very important point they omit, they did not use R's own JIT ! I had a feeling that R is mistreaded there :) Also another imp

Re: [R] Chi-squared test when observed near expected

2012-12-04 Thread David L Carlson
When you typed x as a command, R runs the command print(x). That function produces a summary of the results which may include round off numbers to a few decimal places to make them more readable. When you typed x$statistic, you got the unrounded version of the result 5.6e-31 which I think you will

Re: [R] question about sum of (column) elements in R

2012-12-04 Thread arun
HI, You can use either ?tapply(), ?aggregate(), ?ddply() from library(plyr) dat1<-read.table(text=" 0  12 1  10 1  4 1  6 1  7 1  13 2  21 2  23 2  20 3  18 3  17 3  16 3  27 3  33 4  11 4  8 4  19 4  16 4  9 ",sep="",header=FALSE)  with(dat1,aggregate(dat1[,2],by=list(V1=dat1[,1]),sum))  # V1   x

[R] do.call

2012-12-04 Thread Dominic Roye
Hello, I have a problem with the "do.call-function". I would like to merge the values of more than 30 columns, but not in all of the rows exist values, so with this commando i get a lot of ";" or NA. How get i only the merge of cells with a number? datos$NEW <- do.call(paste, c(datos[,19:53], s

Re: [R] Using multicores in R

2012-12-04 Thread moriah
Thanks for the help, Perhaps I should elaborate a bit, I am working on bioinformatics project in which I am trying to run a forward selection algorithm for machine learning classification of two biological conditions. At each iteration I want to find the gene that in addition to those I have fo

Re: [R] partial analisys of a time series

2012-12-04 Thread arun
HI, You can subset by: birthstimeseriesJan<-subset(birthstimeseries,cycle(birthstimeseries)==1) A.K. - Original Message - From: Antonio Silva To: R-help@r-project.org Cc: Sent: Tuesday, December 4, 2012 4:26 AM Subject: [R] partial analisys of a time series Dear list members I want

Re: [R] partial analisys of a time series

2012-12-04 Thread PIKAL Petr
Hi I am not an expert in time series. The problem is that resulting list is not time series any more. So you need to convert it again to time series and you need to give it frequency greater than 1. something like l.blist <- lapply(blist, function (x) HoltWinters(ts(x, frequency=2))) But this

Re: [R] partial analisys of a time series

2012-12-04 Thread R. Michael Weylandt
Try period.apply() from the xts package. MW On Tue, Dec 4, 2012 at 9:26 AM, Antonio Silva wrote: > Dear list members > > I want to analyze separately the months of a time series. In other words, I > want to plot and fit models for each month separately. > > Taking the example of > http://a-littl

Re: [R] Forest plot

2012-12-04 Thread Michael Dewey
At 20:39 03/12/2012, Min Dong wrote: Hi, I am a novice in R. It will be greatly appreciated if someone can advise me with the following questions. There are at least three packages available from CRAN (meta, metafor, rmeta) which draw forest plots so it would help us if you had told us which

[R] Réponse automatique

2012-12-04 Thread j . boutet
Bonjour, Je serais en congés jusqu'au Jeudi 6 Décembre. Pour des raisons d'urgence, vous pourrez me contacter par téléphone au 06 46 34 81 03. Cordialement, -- Jérôme Boutet Conservatoire d'espaces naturels de Picardie 1, place Ginkgo - village Oasis 80 044 AMIEN

Re: [R] Resampling Help Needed

2012-12-04 Thread Suzen, Mehmet
You can use, 'sample' function for sampling and may consider using partition clustering for selecting your regions, see Cluster task view: http://cran.r-project.org/web/views/Cluster.html On 4 December 2012 00:53, KoopaTrooper wrote: > I am using package ks() to build 3D representations of bird

Re: [R] computing marginal values based on multiple columns?

2012-12-04 Thread Gerrit Eichner
Hello, Simon, see below! On Tue, 4 Dec 2012, Simon wrote: Hello all, I have what feels like a simple problem, but I can't find an simple answer. Consider this data frame: x <- data.frame(sample1=c(35,176,182,193,124), sample2=c(198,176,190,23,15), sample3=c(12,154,21,191,156), class=c('a'

Re: [R] partial analisys of a time series

2012-12-04 Thread Antonio Silva
Thanks Petr I thought there might be an equivalent for birthstimeseries[,1] if it were a dataframe, but split function sounds great. I could not reproduce the second line of your suggestion "l.blist <- lapply(blist, HoltWinters)". I receive the message: Error in decompose(ts(x[1L:wind], start = s

Re: [R] question about sum of (column) elements in R

2012-12-04 Thread Jose Iparraguirre
Hi, Imagine the data you have is in a data frame, c, with columns a and b. Then you can do this: > res=tapply(b,c[,-2],sum) > res[is.na(res)]<-0 > res 0 1 2 3 4 12 40 64 111 63 Hope it helps, José José Iparraguirre Chief Economist Age UK -Original Message- From: r-hel

Re: [R] question about sum of (column) elements in R

2012-12-04 Thread Berend Hasselman
On 04-12-2012, at 08:59, T Bal wrote: > Hi, > I have the following data: > > 0 12 > 1 10 > 1 4 > 1 6 > 1 7 > 1 13 > 2 21 > 2 23 > 2 20 > 3 18 > 3 17 > 3 16 > 3 27 > 3 33 > 4 11 > 4 8 > 4 19 > 4 16 > 4 9 > > > In this data file I would like to sum the numbe

Re: [R] problem with factor levels

2012-12-04 Thread PIKAL Petr
Hi That is quite usual. Excel is so widespread that almost everybody assumes it shall not contain mistakes and behaves correctly. The contrary is true. Spreadsheet often guess what user have on mind and "corrects" values to fit such assumption, let aside mistakes in coded functions. R expects

  1   2   >