Re: [R] [DKIM] Batch Installer for R [SEC=UNCLASSIFIED]

2016-03-31 Thread Li Jin
Hi Tobias, Here is something I acquired from this mailing list some years ago. It works well for me: #---run in previous version (e.g. R 3.1.0) packages <- installed.packages()[,"Package"] save(packages, file="Rpackages_R3.1.0") #---run in new version load("Rpackages_R3.1.0") for (p in setdiff(

Re: [R] Filtering based on the occurrence

2016-03-31 Thread Farnoosh Sheikhi via R-help
Hi Jim,  Thank you tons for your help. The code worked perfectly :) Best,Farnoosh On Wednesday, March 30, 2016 1:13 AM, Jim Lemon wrote: Hi Farnoosh, Despite my deep suspicion that this answer will solve a useless problem, try this: last_subject<-0 keep_deps<-c("B","D","F") keep_rows

Re: [R] Compute the Gini coefficient

2016-03-31 Thread Marine Regis
Hello, Thank you very much for your help. How can I draw a Lorenz curve with several replications ? Here is an example with 4 replications: hosts=c(23,31,19,10,7,7,3, 39,40,8,3,6,2,2, 47,17,8,10,6,11,1, 30,30,10,0,15,15,0) parasites=rep(seq(from=0,to=6,by=1),4) replicat

Re: [R] Ask if an object will respond to a function or method

2016-03-31 Thread David Winsemius
> On Mar 31, 2016, at 1:00 PM, Paul Johnson wrote: > > In the rockchalk package, I want to provide functions for regression > objects that are "well behaved." If an object responds to the methods > that lm or glm objects can handle, like coef(), nobs(), and summary(), > I want to be able to hand

Re: [R] reduced set of alternatives in package mlogit

2016-03-31 Thread Bert Gunter
code? example data? We can only guess based on your vague post. "PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code." Moreover, this sounds like a statistical question, not a question about R programming,

[R] reduced set of alternatives in package mlogit

2016-03-31 Thread Jose Marcos Ferraro
I'm trying to estimate a multinomial logit model but in some choices only alternatives from a subset of all possible alternatives can be chosen. At the moment I get around it by creating "dummy" variables to mean the alternative is not available and let it estimate this coefficient as highly ne

[R] Installing specific version of R

2016-03-31 Thread Sandhya Muloth Vijayachandran
Hi, When I am trying to install specific version of R , using apt-get -y --force-yes install r-base=3.2.1-4precise0 r-recommended=3.2.1-4precise0 r-base-dev=3.2.1-4precise0, I do see correct version being set up in in the logs , but the installed version shows me 3.2.4. Is there anything

Re: [R] Ask if an object will respond to a function or method

2016-03-31 Thread Martin Morgan
On 03/31/2016 04:00 PM, Paul Johnson wrote: In the rockchalk package, I want to provide functions for regression objects that are "well behaved." If an object responds to the methods that lm or glm objects can handle, like coef(), nobs(), and summary(), I want to be able to handle the same thin

Re: [R] converting a class dataframe (chars) to transaction class

2016-03-31 Thread Giorgio Garziano
A more specific reproducible example. set.seed(1023) library(arules) # starting from a dataframe whose fields are characters (see stringsAsFactors = FALSE), as asked products <- c("P1", "P2", "P3", "P4", "P5", "P6", "P7", "P8", "P9", "P10") mydf <- data.frame(user = sample(LETTERS[1:20], 100, re

[R] Ask if an object will respond to a function or method

2016-03-31 Thread Paul Johnson
In the rockchalk package, I want to provide functions for regression objects that are "well behaved." If an object responds to the methods that lm or glm objects can handle, like coef(), nobs(), and summary(), I want to be able to handle the same thing. It is more difficult than expected to ask a

Re: [R] Batch Installer for R

2016-03-31 Thread Federman, Douglas
Does the package packrat do what you want? -- Better name for the general practitioner might be multispecialist. ~Martin H. Fischer (1879-1962) -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Tobias Knuth Sent: Thursday, March 31, 2016 9:05 AM To: r-he

[R] Batch Installer for R

2016-03-31 Thread Tobias Knuth
Hi everyone, in Python, you can run pip install -r filename to install all packages listed in the file. Is there something similar to R? If not, isn't it quite easy to write? For me, it would be much easier to work on projects with other people if I could just install all dependencies with one li

Re: [R] Convergence issues when using ns splines (pkg: spline) in Cox model (coxph) even when changing coxph.control

2016-03-31 Thread Therneau, Terry M., Ph.D.
Thanks to David for pointing this out. The "time dependent covariates" vignette in the survival package has a section on time dependent coefficients that talks directly about this issue. In short, the following model is simply wrong: coxph(Surv(time, status) ~ trt + prior + karno + I(karn

Re: [R] ts or xts with high-frequency data within a year

2016-03-31 Thread Bert Gunter
TYPO on TYPO! It should be X[,3] Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Thu, Mar 31, 2016 at 9:47 AM, Bert Gunter wrote: > Inline. > > B

Re: [R] ts or xts with high-frequency data within a year

2016-03-31 Thread Bert Gunter
Inline. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed, Mar 30, 2016 at 5:37 PM, Ryan Utz wrote: > Bill, Josh, and Bert, > > Thanks for your responses. I

Re: [R] ts or xts with high-frequency data within a year

2016-03-31 Thread Giorgio Garziano
Ryan, >From "decompose()" source code, two conditions can trigger the error message: "time series has no or less than 2 periods" based on the frequency value, specifically: 1. f <= 1 2. length(na.omit(x)) < 2 * f It appears to me that your reproducible code has got a typo error, it shou

[R] function to carry out Bootstrap LRT with poLCA results

2016-03-31 Thread Alain D. via R-help
Dear List, I would like to determine the optimal number of latent classes (polytomous data) using Bootstrap LRT. poLCA does not provide such a possibility and I am not enough into programming to modify the code. Is there any other way to do this, e.g. use a poLCA object with some other package?