Re: [R] Help in using unique count by match function

2012-04-18 Thread Petr PIKAL
Hi Your question is rather cryptic. Why the output shall be 3? What has unique count to do with match function? Maybe you want something what is described in switch help. See ?switch Regards Petr > > Hi > > My code looks like this > > I have two parameters x and par1. X contains values an

[R] Gaussian quadrature for bivariate normal distribution

2012-04-18 Thread Niroshan
Dear R Users I am maximizing a likelihood function it has two two correlated random effects which follows bivariate normal distribution. To get the marginal distribution I want to integrate out with respect to these two correlated random effects. Does any body know how can I implement gaussian q

Re: [R] call object from character?

2012-04-18 Thread chuck.01
I figured as much. Thank you greatly. plangfelder wrote > > On Wed, Apr 18, 2012 at 7:25 PM, chuck.01 > wrote: >> Let say I have an object (I hope my terminology is correct) a >> a <- 12 >>> a >> [1] 12 >> >> And "a" has been assigned the number 12, or whatever >> And let

[R] Help in using unique count by match function

2012-04-18 Thread arunkumar1111
Hi My code looks like this I have two parameters x and par1. X contains values and par1 contains the function which i required to use if par1 is max then output should be max(x). FUN <- match.fun(par1) result=FUN(x) Is it possible to incorporate the unique coun

Re: [R] How to add specific column to data.set?

2012-04-18 Thread R. Michael Weylandt
No like I said, lapply gets columnwise results (if you stopped there, it would tell you whether each country is in the EU separately) and the Reduce() combines them. Re-read my explanation and play around with it on your own data set. To convert 1 -> True and 2 -> False, you could use Boolean

Re: [R] Is the eigen-value decomposition in R generally stable/reliable for large matrix?

2012-04-18 Thread Joshua Wiley
On Wed, Apr 18, 2012 at 9:52 PM, Michael wrote: > Thanks! Speed is not a concern... > > Accuracy and stability is the concern. > > I am actually using the method to find all the roots of a big polynomial... > > Want to see whether it's accurate or not... Well the authors may have written it so th

Re: [R] Is the eigen-value decomposition in R generally stable/reliable for large matrix?

2012-04-18 Thread Michael
Thanks! Speed is not a concern... Accuracy and stability is the concern. I am actually using the method to find all the roots of a big polynomial... Want to see whether it's accurate or not... On Wed, Apr 18, 2012 at 11:46 PM, Joshua Wiley wrote: > Hi Michael, > > There are lots of options, bu

Re: [R] Is the eigen-value decomposition in R generally stable/reliable for large matrix?

2012-04-18 Thread Joshua Wiley
Hi Michael, There are lots of options, but here is a simple one: x <- matrix(rnorm(3000*3000), 3000) e <- eigen(x) only takes a couple minutes on my machine for a 3000 x 3000 matrix. Cheers, Josh On Wed, Apr 18, 2012 at 8:55 PM, Michael wrote: > Say a matrix of size of thousands? > > I am lo

Re: [R] Is the eigen-value decomposition in R generally stable/reliable for large matrix?

2012-04-18 Thread Michael
I am actually looking for a "generalized" eigen-value decomposition algo in R which works on non-symmetrical matrix... I plan to use it for solving high order polynomial equations... Any thoughts? Thank you! On Wed, Apr 18, 2012 at 10:55 PM, Michael wrote: > Say a matrix of size of thousands?

[R] Is the eigen-value decomposition in R generally stable/reliable for large matrix?

2012-04-18 Thread Michael
Say a matrix of size of thousands? I am looking for an eigen-value decomposition algo in R to give good eigenvalues... Is that a hopeful thing? Thank you! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.

Re: [R] Can a matrix have 'list' as rows/columns?

2012-04-18 Thread Worik R
Thanks. That is clear. I need to seperate the concept of Array and Vector in my head. As soon as I hit sendon that last post I realised it is a bit silly to say vectors only contain atomic things. W On Thu, Apr 19, 2012 at 12:35 PM, William Dunlap wrote: >> -Original Message- >> From:

Re: [R] Gls function in rms package

2012-04-18 Thread Frank Harrell
Appears to be a definite bug, probably caused by having more than one correlation parameter. I hope to have this fixed within 3 days. Frank Mark Seeto wrote > > Dear R-help, > > I don't understand why Gls gives me an error when trying to fit a > model with AR(2) errors, while gls (from nlme) do

Re: [R] call object from character?

2012-04-18 Thread Jorge I Velez
Perhaps the following? get(call_A) See ?get for more details. HTH, Jorge.- On Wed, Apr 18, 2012 at 10:25 PM, chuck.01 <> wrote: > Let say I have an object (I hope my terminology is correct) a > a <- 12 > > a > [1] 12 > > And "a" has been assigned the number 12, or whatever > And lets say I hav

Re: [R] call object from character?

2012-04-18 Thread Peter Langfelder
On Wed, Apr 18, 2012 at 7:25 PM, chuck.01 wrote: > Let say I have an object (I hope my terminology is correct) a > a <- 12 >> a > [1] 12 > > And "a" has been assigned the number 12, or whatever > And lets say I have a character "call_A" > call_A <- "a" >>call_A > [1] "a" > > What is the function "

[R] call object from character?

2012-04-18 Thread chuck.01
Let say I have an object (I hope my terminology is correct) a a <- 12 > a [1] 12 And "a" has been assigned the number 12, or whatever And lets say I have a character "call_A" call_A <- "a" >call_A [1] "a" What is the function "F" that allows this to happen: > F( call_A ) [1] 12 -- View this mes

Re: [R] Is there a way to find all roots of a polynomial equation in R?

2012-04-18 Thread Jeff Newmiller
not much to speak of. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Re

Re: [R] Is there a way to find all roots of a polynomial equation in R?

2012-04-18 Thread Michael
how much accuracy does it have when I have a polynomial of thousands of orders? Thank you! On Wed, Apr 18, 2012 at 3:49 PM, Rolf Turner wrote: > On 19/04/12 08:14, Michael wrote: > >> Is there a way to find all roots of a polynomial equation? >> >> Lets say >> >> x^5+a*x^4+b*x^3+c*x^2+d*x+e=0

[R] Gls function in rms package

2012-04-18 Thread Mark Seeto
Dear R-help, I don't understand why Gls gives me an error when trying to fit a model with AR(2) errors, while gls (from nlme) does not. For example: library(nlme) library(rms) set.seed(1) d <- data.frame(x = rnorm(50), y = rnorm(50)) gls(y ~ x, data=d, correlation = corARMA(p=2)) #This works Gl

[R] Survival analysis with events at t=0

2012-04-18 Thread Beutel, Terry S
Dear All Does any one know if the following survival analysis exists, and if so, is it available in R? I am trying to parametrically model survival where some events happen at time = 0. I am particularly interested in generating the 95% confidence interval around the survival function over its

Re: [R] Can a matrix have 'list' as rows/columns?

2012-04-18 Thread William Dunlap
> -Original Message- > From: Worik R [mailto:wor...@gmail.com] > Sent: Wednesday, April 18, 2012 5:05 PM > To: William Dunlap > Cc: r-help > Subject: Re: [R] Can a matrix have 'list' as rows/columns? > > [snip] > > > > sapply.  In this case I would expect M to be a list.  I am gobsmacked t

Re: [R] ggplot2 stat_density2d issue.

2012-04-18 Thread David Winsemius
On Apr 18, 2012, at 7:52 PM, Dmitriy Lyubimov wrote: Sorry. i forgot the lines with parameters for my multivariate normal simulation. here's the code for data simulation i used: === sigm1 <- diag(c(30,50)) sigm2 <- diag(c(5,3)) mu1 <- c(10,15) mu2 <- c(80,60) sample <- rou

Re: [R] Can a matrix have 'list' as rows/columns?

2012-04-18 Thread Worik R
[snip] > > sapply.  In this case I would expect M to be a list.  I am gobsmacked that > > a list can be considered a vector.    Is that a bug?  It must be bad design? > > > > I have been using R for a number of years (5?) and heavilly for two years. > > I am still getting bitten by these "features"

[R] Can I use random Forest package?

2012-04-18 Thread vilike85
Hello R Help, I have a data set with 30 variables, some of these variables are factors while some are numeric. My response variable is binary and I have made sure that this is set as a factor with two levels and given each level a name "Yes" and "No". I would like to run the randomPackage to disco

Re: [R] ggplot2 stat_density2d issue.

2012-04-18 Thread Dmitriy Lyubimov
Sorry. i forgot the lines with parameters for my multivariate normal simulation. here's the code for data simulation i used: === sigm1 <- diag(c(30,50)) sigm2 <- diag(c(5,3)) mu1 <- c(10,15) mu2 <- c(80,60) sample <- round(rbind(rmvnorm(100,mu1,sigm1),rmvnorm(100,mu2,sigm2)))

Re: [R] ggplot2 stat_density2d issue.

2012-04-18 Thread Dmitriy Lyubimov
Thanks David. let's say sample data (two-modal multivariate normal simulation, needs mvtnorm package) = library(mvtnorm) sample <- round(rbind(rmvnorm(100,mu1,sigm1),rmvnorm(100,mu2,sigm2))) sample <- sample[! (sample[,1] <1 | sample[,2] <1 | sample[,1]> 100 | sample[,2]>

Re: [R] Is there a way to find all roots of a polynomial equation in R?

2012-04-18 Thread JesperHybel
>Is there a way to find all roots of a polynomial equation? > >Lets say > >x^5+a*x^4+b*x^3+c*x^2+d*x+e=0 > > >how to find its all roots? > > The package rootSolve might proove interesting __ R-help@ mailing list https://stat.ethz.ch/mailman/listin

Re: [R] ggplot2 stat_density2d issue.

2012-04-18 Thread David Winsemius
On Apr 18, 2012, at 6:55 PM, Dmitriy Lyubimov wrote: Hello, I'd be very grateful for help with some ggplot2's stat_density2d issues. First issue is with data limits. xlim() and ylim() doesn't seem to work; instead, estimates (and plotting) seems to be constrained to range(x), range(y) no m

[R] ggplot2 stat_density2d issue.

2012-04-18 Thread Dmitriy Lyubimov
Hello, I'd be very grateful for help with some ggplot2's stat_density2d issues. First issue is with data limits. xlim() and ylim() doesn't seem to work; instead, estimates (and plotting) seems to be constrained to range(x), range(y) no matter what i do. The documentation says i can pass in kde2d'

[R] Pierce's criterion

2012-04-18 Thread Ryan Murphy
Hello all, I would like to rigorously test whether observations in my dataset are outliers. I guess all the main tests in R (Grubbs) impose the assumption of normality. My data is surely not normal, so I would like to use something else. As far as I can tell from wikipedia, Peirce's criterion i

[R] Numerical integration again

2012-04-18 Thread casperyc
Hi all, Here is an integration function require(pracma) # for 'quadinf' myint=function(j) { quadinf(function(x) (1/(1+exp(-x)))^j*(1-1/(1+exp(-x)))^(k-j)*dnorm(x,mu,casigma),-Inf,Inf) } in any optimization routine. It works fine most of the time but failed with some particular sets of va

Re: [R] quarter end dates between two date strings

2012-04-18 Thread Gabor Grothendieck
On Wed, Apr 18, 2012 at 12:58 PM, Ben quant wrote: > Hello, > > I have two date strings, say "1972-06-30" and "2012-01-31", and I'd like to > get every quarter period end date between those dates? Does anyone know how > to do this? Speed is important... > > Here is a small sample: > > Two dates: >

Re: [R] problem extracting data from a set of list vectors

2012-04-18 Thread MacQueen, Don
Try this (NOT tested) or something similar: all.comps <- ls(pattern="^res") for(i in all.comps) { obj <- all.comops[[i]] gene.ids <- rownames(obj$counts) x <- data.frame(gene.ids = gene.ids, obj$counts, obj$e1, obj$e2, obj$log.fc, obj$p.value, obj$q.value) x <-

Re: [R] problem extracting data from a set of list vectors

2012-04-18 Thread Vining, Kelly
Thanks for your help, Milan, in showing me a way to exhibit the structure of my data. # Again, my data sets are: > [1] "res.Callus.Explant" "res.Callus.Regen" "res.Explant.Regen" # Structure is: > str(res.Callus.Explant) List of 18 $ name : chr "two group comparison" $ group1

Re: [R] how to plot separate lm ablines on the same xyplot by group

2012-04-18 Thread Bert Gunter
x <- rep(1:10,4) y <- runif(40) z <- sample(letters[1:4],40,rep=TRUE) grp <- sample(LETTERS[1:2],40,rep=TRUE) xyplot(y~x|z, group=grp, panel = panel.superpose, panel.groups = function(...){ panel.xyplot(...) panel.lmline(...) }) Keys (legends), colors, line styles,etc, can all be cu

Re: [R] how to plot separate lm ablines on the same xyplot by group

2012-04-18 Thread ilai
On Wed, Apr 18, 2012 at 2:07 PM, Louis Plough wrote: > If you could lead me to an example with code, that would help me figure out > how to do it for my function The states example in ?xyplot uses groups and subscripts in a panel function >> I read it, but I guess I don't quite understand which

Re: [R] interpolation issue

2012-04-18 Thread Petr Savicky
On Wed, Apr 18, 2012 at 07:15:45AM -0700, uday wrote: > hi Petr , > Thanks for replay and sorry for typo mistake > approx(pres, sci.pre) its nothing but approx(pre2, pre1). > > so for more simplicity > x <- c(10.34615 , 52.02116, 146.17357, 243.28644, 347.41504, 431.67105, > 521.4

Re: [R] problem extracting data from a set of list vectors

2012-04-18 Thread Milan Bouchet-Valat
Le mercredi 18 avril 2012 à 13:13 -0700, Vining, Kelly a écrit : > Dear useRs, > > A colleague has sent me several batches of output I need to process, and I'm > struggling with the format to the point that I don't even know how to extract > a test set to upload here. My apologies, but I think t

Re: [R] how to plot separate lm ablines on the same xyplot by group

2012-04-18 Thread Richard M. Heiberger
please look at the ancova function in the HH package. On Wed, Apr 18, 2012 at 3:34 PM, Louis Plough wrote: > Hi, > I am trying to use xyplot to plot the relationship between size and day > (y~x) by a food factor that has two levels, low and high. I have 3 reps per > factor/day. I want the plot

Re: [R] Is there a way to find all roots of a polynomial equation in R?

2012-04-18 Thread Rolf Turner
On 19/04/12 08:14, Michael wrote: Is there a way to find all roots of a polynomial equation? Lets say x^5+a*x^4+b*x^3+c*x^2+d*x+e=0 how to find its all roots? I believe that Galois (or maybe it was Abel) proved that this is *NOT* possible, a couple of centuries ago. However if you are thin

Re: [R] Is there a way to find all roots of a polynomial equation in R?

2012-04-18 Thread Duncan Murdoch
On 12-04-18 4:14 PM, Michael wrote: Is there a way to find all roots of a polynomial equation? Lets say x^5+a*x^4+b*x^3+c*x^2+d*x+e=0 how to find its all roots? polyroot() should be able to do it, assuming that a,b,c,d and e are numeric or complex values, not just symbols. Duncan Murdoch

[R] Is there a way to find all roots of a polynomial equation in R?

2012-04-18 Thread Michael
Is there a way to find all roots of a polynomial equation? Lets say x^5+a*x^4+b*x^3+c*x^2+d*x+e=0 how to find its all roots? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-he

[R] problem extracting data from a set of list vectors

2012-04-18 Thread Vining, Kelly
Dear useRs, A colleague has sent me several batches of output I need to process, and I'm struggling with the format to the point that I don't even know how to extract a test set to upload here. My apologies, but I think that my issue is straightforward enough (for some of you, not for me!) that

Re: [R] General question on the message with non zero exit status

2012-04-18 Thread Chel Hee Lee
Oh... I see!!! I very appreciate for your clear explanation! Thank you, Uwe Ligges. -- View this message in context: http://r.789695.n4.nabble.com/General-question-on-the-message-with-non-zero-exit-status-tp4551438p4568839.html Sent from the R help mailing list archive at Nabble.com. _

[R] comparing linear models

2012-04-18 Thread JesperHybel
I wanted to do an F-test to compare model L2 with L3 assuming heteroskedasticity. The variable KONK2 only has three levels and are for that reason replaced by dummyvariables KONKD1 and KONKD2 in L3. Hence making L4 equivalent to L2. L2<-lm(PRMRES ~ factor(NYPR) + KONK2 + OMS + factor(NYPR)*OMS )

Re: [R] normal distribution assumption for multi-level modelling

2012-04-18 Thread Ben Bolker
Cecile De Cat leeds.ac.uk> writes: > I'm analysing reaction time data from a linguistic experiment (a variant of > a lexical decision task). To ascertain that the data was normally > distributed, I used *shapiro.test *for each participant (see commands > below), but only one out of 21 returns a

Re: [R] how to plot separate lm ablines on the same xyplot by group

2012-04-18 Thread Louis Plough
If you could lead me to an example with code, that would help me figure out how to do it for my function On Wed, Apr 18, 2012 at 3:57 PM, Louis Plough wrote: > I read it, but I guess I don't quite understand which arguments to pass > panel.groups to get different lm objects based on the two gro

Re: [R] How to add specific column to data.set?

2012-04-18 Thread phillip03
So the lapply function checks every country pair row for row (in my country1 and country2 column) and send back a true if both countries are EU? How do I get a 1 instead of true and 2 instead of false? You have been a BIG help. I have a WHOLE assignment to get done, so maybe I'll post some more

[R] Error: X11 fatal IO error: please save work and shut down R when ssh connection broken

2012-04-18 Thread regcl
I ues R on a Linux server running under Screen or Emacs server from a Mac desktop. I use Screen and/or Emacs server so that I can reattach to long running sessions, and this works well except... If X11 server on my desktop is shut down, or my ssh connection is broken, I get this error on the n

[R] install qvalue from biocLite

2012-04-18 Thread liwang
dear list members I tried to install qvalue package from biocLite, and I am confronted with the following error: Tcl/Tk support is not available on this system. I installed the newest version of Tcl/Tk in my system, and then uninstall and install R 2.15.0 again. I did the command line as ./co

[R] multi-machine parallel setup?

2012-04-18 Thread ivo welch
Dear R experts: could someone please point me to a page that explains how to set up more than 1 machine for library parallel (which is quickly becoming my favorite!) my dream setup would be a design where I just pass a list of hostnames:user:password to my parallel master, and then start R listen

Re: [R] how to plot separate lm ablines on the same xyplot by group

2012-04-18 Thread Bert Gunter
Please read ?panel.superpose again and pay attention to the panel.groups argument, where this can be specified. -- Bert On Wed, Apr 18, 2012 at 12:34 PM, Louis Plough wrote: > Hi, > I am trying to use xyplot to plot the relationship between size and day > (y~x) by a food factor that has two lev

Re: [R] introducing R to high school students

2012-04-18 Thread Hadley Wickham
> If the students are in a "science research" class, does that mean they > have data from their own research that they would want to understand > better?  I think that would be much more motivating than anything else. It might depends on the class - most high school science experiments aren't that

[R] how to plot separate lm ablines on the same xyplot by group

2012-04-18 Thread Louis Plough
Hi, I am trying to use xyplot to plot the relationship between size and day (y~x) by a food factor that has two levels, low and high. I have 3 reps per factor/day. I want the plots from each food treatment on the same axiss, so I used this code: xyplot(Size ~ Day, groups = Food, data = louis.data

Re: [R] quarter end dates between two date strings

2012-04-18 Thread Marc Schwartz
On Apr 18, 2012, at 1:49 PM, David Winsemius wrote: > > On Apr 18, 2012, at 2:05 PM, Marc Schwartz wrote: > >> On Apr 18, 2012, at 11:58 AM, Ben quant wrote: >> >>> Hello, >>> >>> I have two date strings, say "1972-06-30" and "2012-01-31", and I'd like to >>> get every quarter period end date

Re: [R] normal distribution assumption for multi-level modelling

2012-04-18 Thread Bert Gunter
Cecile: On Wed, Apr 18, 2012 at 8:21 AM, Cecile De Cat wrote: > Hello, > > I'm analysing reaction time data from a linguistic experiment (a variant of > a lexical decision task).   To ascertain that the data was normally > distributed, I used *shapiro.test *for each participant (see commands > be

Re: [R] quarter end dates between two date strings

2012-04-18 Thread David Winsemius
On Apr 18, 2012, at 2:05 PM, Marc Schwartz wrote: On Apr 18, 2012, at 11:58 AM, Ben quant wrote: Hello, I have two date strings, say "1972-06-30" and "2012-01-31", and I'd like to get every quarter period end date between those dates? Does anyone know how to do this? Speed is important.

Re: [R] Error with Rcmd check library --as-cran

2012-04-18 Thread Duncan Murdoch
On 12-04-17 11:50 PM, David Bapst wrote: Hi all- Henrik, packageDescription informs me that I have Matrix version 1.0-6, which is the newest version on CRAN. The --as-cran check in R 2.15.0 is a little bit too aggressive: this was a spurious error. If your package depends on another package

Re: [R] Amelia error

2012-04-18 Thread Gaurav Sood
Easily fixed, Peter - str(ad04) 'data.frame': 1195 obs. of 15 variables: $ V040001 : num 1 2 3 4 5 6 7 8 9 10 ... $ insurance: num 7 2 4 1 5 2 7 1 5 5 ... $ jobs : num 7 3 4 1 6 5 7 5 4 7 ... $ services : num 5 2 5 1 5 2 7 1 4 7 ... $ ss : num 2 2 2 1 2 1 2 1 1 3 ... $ wom

Re: [R] Amelia error

2012-04-18 Thread Gaurav Sood
Sarah - I have all the vars.. they all look sensible. I have been able to trace the problem to NAs in the nominal variable, which is a bit strange. The error that the program spits out is a class logical equating error in presence of NAs etc. and hence was my hunch that it was a bug. On Wed, A

Re: [R] Amelia error

2012-04-18 Thread Peter Ehlers
On 2012-04-18 11:18, Gaurav Sood wrote: Using: Amelia::amelia R version: 2.15 OS: Windows 7 Enterprise data = National Election Studies (cross-sectional); mostly ordinal variables, some nominal summary(ad04) insurance jobs services sswomen Min.

Re: [R] Amelia error

2012-04-18 Thread Sarah Goslee
Hi, On Wed, Apr 18, 2012 at 2:18 PM, Gaurav Sood wrote: > Using: Amelia::amelia > > R version: 2.15 > OS: Windows 7 Enterprise > > data = National Election Studies (cross-sectional); mostly ordinal > variables, some nominal > > summary(ad04) > >   insurance          jobs          services        

Re: [R] Amelia error

2012-04-18 Thread David Freedman
I've had a little experience using the package, Amelia. Are you sure that your nominal variables - race, south, etc - are in your ad04 data frame ? David Freedman -- View this message in context: http://r.789695.n4.nabble.com/Amelia-error-tp4568455p4568600.html Sent from the R help mailing lis

Re: [R] Amelia error

2012-04-18 Thread Gaurav Sood
Using: Amelia::amelia R version: 2.15 OS: Windows 7 Enterprise data = National Election Studies (cross-sectional); mostly ordinal variables, some nominal summary(ad04) insurance jobs services sswomen Min. :1.000 Min. :1.000 Min. :1.000 Min

Re: [R] introducing R to high school students

2012-04-18 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Hadley Wickham > Sent: Wednesday, April 18, 2012 10:37 AM > To: Christopher W Ryan > Cc: R-help > Subject: Re: [R] introducing R to high school students > > > Now I have to pu

Re: [R] quarter end dates between two date strings

2012-04-18 Thread Marc Schwartz
On Apr 18, 2012, at 11:58 AM, Ben quant wrote: > Hello, > > I have two date strings, say "1972-06-30" and "2012-01-31", and I'd like to > get every quarter period end date between those dates? Does anyone know how > to do this? Speed is important... > > Here is a small sample: > > Two dates: >

Re: [R] parallel processing with multiple directories

2012-04-18 Thread David Schaefer
Hi Rainier, Thanks for your suggestions. I should have been more specific, I am using multiple cores on a Mac Pro running Snow Leopard. I can see where that makes a difference. --David On 4/18/12 12:13 AM, "Rainer M Krug" wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 17/04/12 20

Re: [R] Amelia error

2012-04-18 Thread Sarah Goslee
Do you mean the Amelia package? Or a function named Amelia()? What is your OS and version of R and package? What are the commands you are using? What do your data look like? Can you provide a reproducible example? Did you read the posting guide? Your problem doesn't "seem like a bug" rather t

Re: [R] introducing R to high school students

2012-04-18 Thread Hadley Wickham
> Now I have to put my money where my mouth is. I've offered to visit a > high school and introduce R to some fairly advanced students > participating in a longitudinal 3-year science research class. > > I anticipate keeping things very simple: > --objects and the fact that there is stuff inside th

[R] Amelia error

2012-04-18 Thread Gaurav Sood
Hi, Encountering the following error using Amelia - Error in if (sum(non.vary == 0)) { : argument is not interpretable as logical In addition: Warning message: In FUN(X[[34L]], ...) : NAs introduced by coercion Seems like a bug. __ R-help@r-project.

Re: [R] introducing R to high school students

2012-04-18 Thread David Winsemius
On Apr 18, 2012, at 12:31 PM, Jeff Newmiller wrote: I think that mostly avoiding the statistics and matrix capabilities is wise. You might want to (re-)read Burns' article on Spreadsheet Addiction for help in justifying the effort required to learn R. In that vein, there is a classic exper

Re: [R] writing spdiags function for R

2012-04-18 Thread Moreno I. Coco
Hi Ben, A couple of quick comments: the semicolons at the end of each line are unnecessary (they're harmless, but considered bad style -- most common in code of C and MATLAB coders yes, I know, just forgot to clean it up after translating :) You don't need to source("getband.R") inside

[R] quarter end dates between two date strings

2012-04-18 Thread Ben quant
Hello, I have two date strings, say "1972-06-30" and "2012-01-31", and I'd like to get every quarter period end date between those dates? Does anyone know how to do this? Speed is important... Here is a small sample: Two dates: "2007-01-31" "2012-01-31" And I'd like to get this: [1] "2007-03-

Re: [R] introducing R to high school students

2012-04-18 Thread Jeff Newmiller
I think that mostly avoiding the statistics and matrix capabilities is wise. You might want to (re-)read Burns' article on Spreadsheet Addiction for help in justifying the effort required to learn R. In that vein, there is a classic experiment where a small ball is rolled down an inclined pane

Re: [R] simple time series plot

2012-04-18 Thread William Dunlap
Try recording the data as a rectangle with 3 entries in each row timestamp, sensor_id, sensor_reading You can read this into an R data.frame, sensorData, with a call to read.csv then use z <- split(sensorData, sensorData$sensor_id) to make a list of data.frames, one for each sensor, that you

Re: [R] Displaying data in Trellis

2012-04-18 Thread ilai
On Wed, Apr 18, 2012 at 8:45 AM, slavrenz wrote: I would like to display with the xyplot() function > for several states. I will have a total of 6 plots, I need to plot the > points of one of the states in a different color than all the rest, such > that they can be more easily referenced in a p

Re: [R] simple time series plot

2012-04-18 Thread phibo
Hi Michael, that's exactly the problem. The format for time series you suggest requires to have a reading from every timestamp of every sensor. But that is not the case at all, unfortunately :-( It might well be in my case, that one sensor reports 1000 readings during one day while the other one

Re: [R] Support for R in highlight.js

2012-04-18 Thread jjallaire
Hi Ivan, We are in the process of creating an R mode for highlight.js -- will send you a pull request as soon as its ready. Cheers, J.J. Allaire j...@rstudio.org -- View this message in context: http://r.789695.n4.nabble.com/Support-for-R-in-highlight-js-tp4551547p4568141.html Sent from the R

[R] Text mining: Narrowing a field of 27, 855 predictors using semi-partial correlations or some other means

2012-04-18 Thread Paul Miller
Hello Everyone, Trying to learn a little bit about data mining. I'm working on a text mining project that will attempt to predict whether cancer patients got a particular type of genetic testing. A subsequent stage then will be aimed at predicting what the results of that testing were.   I've

Re: [R] Displaying data in Trellis

2012-04-18 Thread slavrenz
By the way, as I've been reading through some other posts on here, let me clarify that this isn't for a homework assignment or anything. This is something I am working on as part of my dissertation. -- View this message in context: http://r.789695.n4.nabble.com/Displaying-data-in-Trellis-tp456792

[R] normal distribution assumption for multi-level modelling

2012-04-18 Thread Cecile De Cat
Hello, I'm analysing reaction time data from a linguistic experiment (a variant of a lexical decision task). To ascertain that the data was normally distributed, I used *shapiro.test *for each participant (see commands below), but only one out of 21 returns a p value above p.0 05. > f = functio

[R] Multidimensional Array: local averaging without knowing number of dimensions

2012-04-18 Thread Sebastian Schubert
Hi, I want to access and modify a multi dimensional array but without knowing the exact number of dimensions. Basically. I want something like that for every i (except boundaries of course): field[i, ...] <- (field[i, ...] + field[i+1, ...] + field[i-1, ...])/3 In principle, ... should just rep

Re: [R] Help with creating conditional categorical variables in R

2012-04-18 Thread R. Michael Weylandt
Your problem is that columns A & B contain something that can't be ordered. (Likely "factor" (=categorical) data like Male / Female rather than numeric like 10 and 5) Use str(data_2) to see what classes your data are -- they sometimes get converted in unexpected ways if you aren't careful in setti

Re: [R] interpolation issue

2012-04-18 Thread R. Michael Weylandt
Your problem is that length(x) != length(y) approx uses linear interpolation but there's no way to make sense of that if you can't match up the x and y coordinates -- and you can't match up the x and y coordinates if there aren't the same number of them. Michael On Wed, Apr 18, 2012 at 10:15 AM,

Re: [R] simple time series plot

2012-04-18 Thread R. Michael Weylandt
The preferred format for time series will be something like this: Sensor1Sensor2 Sensor3 T1 Read1_1 Read2_1 Read3_1 T2 Read1_2 Read2_2 Read3_2 T3 Read1_3 Read2_3 Read3_3 if you can get that. CSV separations are nice but not as essential as the columnar organization. (It's pos

Re: [R] interpolation issue

2012-04-18 Thread uday
hi Petr , Thanks for replay and sorry for typo mistake approx(pres, sci.pre) its nothing but approx(pre2, pre1). so for more simplicity x <- c(10.34615 , 52.02116, 146.17357, 243.28644, 347.41504, 431.67105, 521.42712, 629.00446 ,729.95941, 827.86279, 921.55078, 956.6) y <- c(

Re: [R] simple time series plot

2012-04-18 Thread phibo
Thanks for your reply! As I write the script to export the data from the database myself, I'm free to sort the data (almost) at will. I can either export to CSV in the form of sensor1 timestamp1, reading1, timestamp2, reading2, timestamp2, reading2... sensor2 timestamp1, reading1, timestamp2, r

[R] Help with creating conditional categorical variables in R

2012-04-18 Thread Dwaipayan Dasgupta
Hi, I am stuck with creating a conditional categorical variable in R If my dataframe data_2 has 3 variables A,B,CI want to create variable D which would be something like : data_2$D <- ifelse(data_2$A < data_2$B & promotion_ind =="N",1,0), this throws up an error "In Ops.factor(data_2$A,dat

[R] problem in tk_choose.files

2012-04-18 Thread julio cesar oliveira
Dear list, I can't use the choose.files for list the 2,000 files in directory. # list files > names <- (tk_choose.files(default = "", caption = "Select the files ", +multi = TRUE, filters = Filt, +index = 1)) > > > names character(0) # names is empty

Re: [R] packages install dependencies

2012-04-18 Thread mail.bioinfo
Hi Uwe It works modifying a little bit your command instead of "file:=/home/..." I used "file:///home/..." install.packages("marginalmodelplots", dependencies=TRUE, contriburl="file:///home/bioadm/install/R_packages/test/") Thanks for your time and your patience Regards Joël -Message d

[R] Displaying data in Trellis

2012-04-18 Thread slavrenz
This is a question relating to the Trellis function in R. I have a set of socioeconomic data that I would like to display with the xyplot() function for several states. I will have a total of 6 plots, with the y-variable as "Age Group", and the x-variable as "Median Income". Suitability of the plo

Re: [R] introducing R to high school students

2012-04-18 Thread Tyler Rinker
Indrajit, As a former math teacher I understand your concerns wholly.  My perspective is that this must be approached with caution so you don't miss out on the important learning but I think with proper guidance and scaffolding this could be an amazing tool.  We already using the graphing capab

Re: [R] introducing R to high school students

2012-04-18 Thread Steve_Friedman
Christopher, I originally thought about writing off list to avoid a plethora of babble. However here goes. I don't see any reason why good students can 't learn the fundamentals of R. It has lots of advance methods that perhaps are too complex to handle for younger - less experienced people. On

Re: [R] Kaplan Meier analysis: 95% CI wider in R than in SAS

2012-04-18 Thread Paul Miller
Thanks for the clarification Dr. Therneau. Until I learn more about this I can at least remember that "plain" is bad. Thanks, Paul --- On Mon, 4/16/12, Terry Therneau wrote: > From: Terry Therneau > Subject: Re: Kaplan Meier analysis: 95% CI wider in R than in SAS > To: r-help@r-project.org,

Re: [R] introducing R to high school students

2012-04-18 Thread Christopher W. Ryan
Thanks all for the excellent thought-provoking comments. I want to clarify that these students are, for good or for ill, already doing all these analytical and graphical things for their projects. They are doing them with Excel and SPSS. One of my goals would be to teach them how they can be done

Re: [R] Installing texlive dependencies

2012-04-18 Thread Petar Milin
Thanks very much! However, I tried with that (ln -s /usr/local/texlive/2011 /usr/share/texmf) without luck. yum is still asking for a list of dependencies, including several texlive files. All the best, Petar On Wed, 2012-04-18 at 08:58 -0400, Randy Johnson wrote: > I can't make any guaranties,

Re: [R] interpolation issue

2012-04-18 Thread Petr Savicky
On Wed, Apr 18, 2012 at 03:55:07AM -0700, uday wrote: > This moment I got stuck with one interpolation issue > the sample data which I have is as follows > > pre1 <- c(10.34615 , 52.02116, 146.17357, 243.28644, 347.41504, 431.67105, > 521.42712, 629.00446 ,729.95941,82

Re: [R] Installing texlive dependencies

2012-04-18 Thread Marc Schwartz
On Apr 18, 2012, at 6:31 AM, Petar Milin wrote: > Hello ALL! > I am running Fedora 16 x86_64. Due to some dubious problems with the > TeXLive (2007, which is a default), I removed it. That removed R as > well, and some other dependent packages. Then, I installed TeXLive 2011 > from CTAN. However,

Re: [R] packages install dependencies

2012-04-18 Thread Uwe Ligges
On 18.04.2012 14:01, mail.bioi...@fr.netgrs.com wrote: Hi Uwe I tried install.packages("marginalmodelplots", dependencies=TRUE, contriburl="/home/bioadm/install/R_packages/test") Whoops, this was untested an it turns out you need: contriburl="file:/home/bioadm/install/R_packages/test" re

Re: [R] random effects using lmer

2012-04-18 Thread Ben Bolker
HughSt hotmail.com> writes: > I am trying to run a logistic regression to look at the risk of malaria > infection in individuals. I want to account for intra household correlation > and so want to include a household level random effect. I have been using > the lmer command in lme4 package but am

Re: [R] Installing texlive dependencies

2012-04-18 Thread Randy Johnson
I can't make any guaranties, but placing a symbolic link at /usr/share/texmf, pointing at /usr/local/texlive/2011 might do the trick. It's a bit of a hack, but that often works for me. Best, Randy On Apr 18, 2012, at 7:31 AM, Petar Milin wrote: > Hello ALL! > I am running Fedora 16 x86_64. Due

  1   2   >