Re: [R] Grouping and/or splitting

2012-04-03 Thread Ashish Agarwal
Thanks a ton! It was weird because according to me ordering should have by default. Anyways, your workaround along with Weidong's method are both good solutions. On Wed, Apr 4, 2012 at 12:10 PM, Berend Hasselman wrote: > > On 04-04-2012, at 07:15, Ashish Agarwal wrote: > > > Yes. I was missing th

[R] multivariate ordered probit regression---use standard bivariate normal distribution?

2012-04-03 Thread Trey Batey
Hello. I have yet to receive a response to my previous post, so I may have done a poor job asking the question. So, here is the general question: how can I run a run a multivariate (more than one non-independent, response variables) ordered probit regression model? I've had success doing this in t

Re: [R] Grouping and/or splitting

2012-04-03 Thread Berend Hasselman
On 04-04-2012, at 07:15, Ashish Agarwal wrote: > Yes. I was missing the DROP argument. > But now the problem is splitting is causing some weird ordering of groups. Why weird? > See below: > > DF <- read.table(text=" > Houseid,Personid,Tripid,taz > 1,1,1,4 > 1,1,2,7 > 2,1,1,96 > 2,1,2,4 > 2,1,3

Re: [R] Trying to merge new data set to bottom of old data set. Both are zoo objects.

2012-04-03 Thread knavero
Here's a case where it doesn't work. Again, the problem is that when I use the rbind or concatenate functions, the 2012 data set seems to go ahead of the 2010 and 2011 portions of the data set. The problem seems dependent on the text files I read in: http://r.789695.n4.nabble.com/file/n4531011/old

[R] Trying to merge new data set to bottom of old data set. Both are zoo objects.

2012-04-03 Thread knavero
Here is the data I'm working with: http://r.789695.n4.nabble.com/file/n4530888/new.txt new.txt http://r.789695.n4.nabble.com/file/n4530888/old.txt old.txt My code is here: http://pastebin.com/9jjs6Ahr I'm looking for away to simply attach the new.txt to the bottom of old.txt through R, else

Re: [R] image.plot adding x-axis labels. Please Help

2012-04-03 Thread David Lyon
Sorry that didnt work for me, any ideas? - Original Message - From: ilai To: David Lyon Cc: "r-help@r-project.org" Sent: Tuesday, April 3, 2012 10:43 PM Subject: Re: [R] image.plot adding x-axis labels. Please Help On Tue, Apr 3, 2012 at 7:25 PM, David Lyon wrote: > if I had a data f

Re: [R] BRugs crash, question

2012-04-03 Thread Bob O'Hara
On 4 April 2012 05:35, Jack Tanner wrote: > (Using BRugs 0.7-5, R 2.14.2 32-bit on 64-bit Windows 7, OpenBUGS 3.2.1) > > 1. BRugs crashes R for me as follows. Sorry about the lack of detail; > please let > me know if / how to supply a more useful bug report on this issue. > > fit <- BRugsFit(...)

Re: [R] logistic regression

2012-04-03 Thread Jack Tanner
Melrose2012 stonybrook.edu> writes: > > alive <- (fflies$living) > dead <- (fflies$living[1]-alive) > glm.fit <- glm(cbind(alive,dead)~fflies$day,family="binomial") > summary(glm.fit) Your call to glm() is not doing what you think it's doing. What you want to do is probably closer to glm.fit

Re: [R] Compare by row and insert previous row value (Or non Time Series Lag)

2012-04-03 Thread Ashish Agarwal
Hello my old friend. Remember me from Cambridge. Here is the dirty way of getting your desired output and enjoy hassling with trips that are incomplete or missing information inpfil <- read.csv("sample_trip_od_input.csv") aa <- split(inpfil, paste(inpfil[,1],inpfil[,2],sep=',')) OrigTAZ <- inpfil

Re: [R] list assignment syntax?

2012-04-03 Thread Bert Gunter
Ivo: The primary source of your problems appears to be: "Unfortunately, for a generic programming language, R still lacks some sugar." R is **not** a generic programming language, nor was it ever meant to be one. Have you read Chambers's et al books? R was designed as a language for data analysi

Re: [R] logistic regression

2012-04-03 Thread Jorge I Velez
Hi Melissa, I would highly encourage you to read [1]. It would be extremely beneficial for your understanding of the type of models you should use in a situation like yours (count data). Best regards, Jorge.- [1] cran.r-project.org/web/packages/pscl/vignettes/countreg.pdf On Wed, Apr 4, 201

Re: [R] Grouping and/or splitting

2012-04-03 Thread Ashish Agarwal
Yes. I was missing the DROP argument. But now the problem is splitting is causing some weird ordering of groups. See below: DF <- read.table(text=" Houseid,Personid,Tripid,taz 1,1,1,4 1,1,2,7 2,1,1,96 2,1,2,4 2,1,3,2 2,2,1,58 3,1,5,7 ", header=TRUE, sep=",") aa <- split(DF, DF[, 1:2], drop=TRUE)

Re: [R] logistic regression

2012-04-03 Thread Melrose2012
Thank you for your reply. I do understand that I am working in log space with the default link function of the binomial being "logit." My problem is, I thought that they way I had written the code, when I did the "lines" command, it should plot the best-fit line (found by 'glm') on top of my gr

Re: [R] logistic regression

2012-04-03 Thread Bert Gunter
Get help. You do not understand glm's. What do you think the fitted values are? -- Hint: they are *not* an estimate of the number of living fruit flies. -- Bert On Tue, Apr 3, 2012 at 6:25 PM, Melrose2012 wrote: > I am trying to plot the logistic regression of a dataset (# of living flies > vs d

Re: [R] CSPADE error: system invocation error

2012-04-03 Thread R. Michael Weylandt
I'm heading to bed now but will try to get a look at this in the morning - forwarding this to R-help so others have a chance of getting to it before me. (Particularly those who know the package better than me) Michael On Apr 4, 2012, at 12:44 AM, Sue Xu wrote: > Hi Michael, > > sessionInfo b

Re: [R] CSPADE error: system invocation error

2012-04-03 Thread R. Michael Weylandt
It works fine for me: can you give sessionInfo()? Michael On Tue, Apr 3, 2012 at 9:27 PM, Sue Xu wrote: > Hi, > > I am trying to use the CSPADE function as part of the ArulesSequences > package. When running with my own data I get a system invocation error, and > also get the same when running

Re: [R] A introductory question about Zips law (Newbie to statistics)

2012-04-03 Thread R. Michael Weylandt
The zipfR package might be of help to you Michael On Sat, Mar 31, 2012 at 2:03 AM, ali_protocol wrote: > Hi everyone. > > Newbie to statistics. > > I have 40 matrices of ~400 values. how may I determine whether the > distribution follows zips law? > > response <-sample (1:20,400*4, replace= TRUE

Re: [R] how to map microarray probe to gene, homology

2012-04-03 Thread Ekta Jain
Hi, You could use the s apply function to create a data frame of the annotation. If hgu133 plus 2.0 is your chip something like the following could be employed >myAnnot <- data.frame(ACCNUM=sapply(contents(hgu133plus2ACCNUM), paste, >collapse=", "), SYMBOL=sapply(contents(hgu133plus2SYMBOL), pas

Re: [R] how to load functions from file

2012-04-03 Thread Jorge I Velez
?source On Tue, Apr 3, 2012 at 11:54 PM, John Kohr <> wrote: > > Hello, > > I have several functions in an .R file. I try to load them with load() > command but it seems is not working.. > > if .R is in /home/user/myfunctions.R > > how can i load it? is there any other way? > > Thanks > >

[R] how to load functions from file

2012-04-03 Thread John Kohr
Hello, I have several functions in an .R file. I try to load them with load() command but it seems is not working.. if .R is in /home/user/myfunctions.R how can i load it? is there any other way? Thanks [[alternative HTML version deleted]] _

[R] BRugs crash, question

2012-04-03 Thread Jack Tanner
(Using BRugs 0.7-5, R 2.14.2 32-bit on 64-bit Windows 7, OpenBUGS 3.2.1) 1. BRugs crashes R for me as follows. Sorry about the lack of detail; please let me know if / how to supply a more useful bug report on this issue. fit <- BRugsFit(...) # BRugs and OpenBUGS runs fine, the parameter estimates

Re: [R] A contour plot question - vis.gam () function in "mgcv"

2012-04-03 Thread Ravi Varadhan
Thank you, Peter. I don't know why I didn't think of this! Also, thanks to Ilai. Ravi From: Peter Ehlers [ehl...@ucalgary.ca] Sent: Tuesday, April 03, 2012 8:22 PM To: ilai Cc: Ravi Varadhan; r-help@r-project.org Subject: Re: [R] A contour plot question

Re: [R] logistic regression

2012-04-03 Thread Melrose2012
No, this is related to my own data. Yes, 'fflies' the dataset - here I am working with two columns: # of fruit flies alive vs # of days these flies are alive. There is no error, it's just that the best-fit line does not plot nicely on top of my data (see figure attached). http://r.789695.n4.nabb

Re: [R] image.plot adding x-axis labels. Please Help

2012-04-03 Thread ilai
On Tue, Apr 3, 2012 at 7:25 PM, David Lyon wrote: > if I had a data file like this: > 1.42 1.29 -0.13 > 1.46 1.34 -0.12 > 1.45 1.32 -0.13 > 1.36 1.26 -0.10 > 1.33 1.29 -0.04 > > I want to create a image plot like this: > data1<-read.table("A") > > image.plot(t(data1), axes=FALSE, xlab=NA, ylab=NA)

[R] CSPADE error: system invocation error

2012-04-03 Thread Sue Xu
Hi, I am trying to use the CSPADE function as part of the ArulesSequences package. When running with my own data I get a system invocation error, and also get the same when running the built in example with the zaki data: > example(cspade) And get the following error: preprocessing ...Error i

[R] image.plot adding x-axis labels. Please Help

2012-04-03 Thread David Lyon
if I had a data file like this: 1.42 1.29 -0.13 1.46 1.34 -0.12 1.45 1.32 -0.13 1.36 1.26 -0.10 1.33 1.29 -0.04 I want to create a image plot like this: data1<-read.table("A") image.plot(t(data1), axes=FALSE, xlab=NA, ylab=NA) I cant get the labels for the x axis right can some kind person help

Re: [R] Grouping and/or splitting

2012-04-03 Thread Rui Barradas
Hello, Ashish Agarwal wrote > > I have a dataframe imported from csv file below: > > Houseid,Personid,Tripid,taz > 1,1,1,4 > 1,1,2,7 > 2,1,1,96 > 2,1,2,4 > 2,1,3,2 > 2,2,1,58 > > There are three groups identified based on the combination of first and > second columns. How do I split this data

Re: [R] Non-linear least squares

2012-04-03 Thread n.surawski
Thanks for these comments! -- View this message in context: http://r.789695.n4.nabble.com/Non-linear-least-squares-tp4524812p4530664.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.c

Re: [R] logistic regression

2012-04-03 Thread David Winsemius
On Apr 3, 2012, at 9:25 PM, Melrose2012 wrote: I am trying to plot the logistic regression of a dataset (# of living flies vs days the flies are alive) and then fit a best-fit line to this data. Here is my code: plot(fflies$living~fflies$day,xlab="Number of Days",ylab="Number of Fruit F

[R] logistic regression

2012-04-03 Thread Melrose2012
I am trying to plot the logistic regression of a dataset (# of living flies vs days the flies are alive) and then fit a best-fit line to this data. Here is my code: plot(fflies$living~fflies$day,xlab="Number of Days",ylab="Number of Fruit Flies",main="Number of Living Fruit Flies vs Day",pch=16) a

Re: [R] A contour plot question - vis.gam () function in "mgcv"

2012-04-03 Thread Peter Ehlers
On 2012-04-03 15:49, ilai wrote: Try to plot the points first followed by vis.gam(...,type='contour', color='bw', add=T) instead of vis.gam followed by points. HTH Or, if vis.gam gives you default scales that you wish to preserve, then just replot the contours over the points with vis.gam(

Re: [R] Import from excel button in R-command

2012-04-03 Thread Jeff Newmiller
I see that David W has already suggested some possibilities for GUI solutions, but I would like to add that avoiding typing commands is counter-productive with R even if you have a GUI. Collecting sequences of commands in a text file and copy/pasting them into the command line is the most produc

Re: [R] Grouping and/or splitting

2012-04-03 Thread Weidong Gu
how about split(inpfil, paste(inpfil[,1],inpfil[,2],sep=',')) Weidong Gu On Tue, Apr 3, 2012 at 6:42 PM, Ashish Agarwal wrote: > I have a dataframe imported from csv file below: > > Houseid,Personid,Tripid,taz > 1,1,1,4 > 1,1,2,7 > 2,1,1,96 > 2,1,2,4 > 2,1,3,2 > 2,2,1,58 > > There are three gro

Re: [R] R equivalent for SQL query

2012-04-03 Thread Henrique Dallazuanna
Here is another way: aggregate(.~ A + B, FUN = length, x) On Tue, Apr 3, 2012 at 3:26 PM, Steven Raemaekers wrote: > Hi, > > I have a query which I would like to translate into R, but I do not know > how to do it in an easy way. > Assume a data frame has columns A, B and C: > > A B

Re: [R] Histogram from a table in R

2012-04-03 Thread Robert Baer
intv = c('0-19','10-19','20-29','30-39') cnts = c(0, 3117, 4500, 2330) barplot(cnts, space=0, names = intv, xlab='Age Range', ylab = 'Counts', main='My Histogram') -Original Message- From: gina_alessa Sent: Tuesday, April 03, 2012 4:08 PM To: r-help@r-project.org Subject: [R] Histogra

Re: [R] list assignment syntax?

2012-04-03 Thread ivo welch
I finally got around to posting my list of R gripes on a blog at http://ivo-welch.blogspot.com/2012/04/r-annoyances-and-gripes.html . I did put in some time, but I do not expect anyone to read it. it was more for myself. still, if you are curious, I would love to hear where I got it wrong and whe

Re: [R] Nlme not working on very similar initial values

2012-04-03 Thread Bert Gunter
Welcome to the wonderful world Of nonlinear model fitting in ill-conditioned problems. See also chaos theory. Bert Sent from my iPhone -- please excuse typos. On Apr 3, 2012, at 3:03 PM, Ramiro Barrantes wrote: > Hello, > > I am using CentOS Linux 6.0, R 2.14.1 and nlme 3.1-103 > > I am t

Re: [R] A contour plot question - vis.gam () function in "mgcv"

2012-04-03 Thread ilai
Try to plot the points first followed by vis.gam(...,type='contour', color='bw', add=T) instead of vis.gam followed by points. HTH On Tue, Apr 3, 2012 at 2:48 PM, Ravi Varadhan wrote: > Hi, > > Please see the attached contour plot (I am sorry about the big file).  This > was created using the

Re: [R] Histogram from a table in R

2012-04-03 Thread Peter Alspach
Tena koe Possibly barplot() is what you are after. ?barplot HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of gina_alessa Sent: Wednesday, 4 April 2012 9:08 a.m. To: r-help@r-project.org Subject: [R] Histogr

[R] Grouping and/or splitting

2012-04-03 Thread Ashish Agarwal
I have a dataframe imported from csv file below: Houseid,Personid,Tripid,taz 1,1,1,4 1,1,2,7 2,1,1,96 2,1,2,4 2,1,3,2 2,2,1,58 There are three groups identified based on the combination of first and second columns. How do I split this data frame? I tried aa <- split(inpfil, inpfil[,1:2]) but it

[R] Looking for the name of a certain kind of quantile plot

2012-04-03 Thread Carl Witthoft
Hi, While playing with quantile-quantile plots, I wrote up some code which plots something strangely different. Here's the pseudocode: testhist <- hist(sample_data) refhist <- hist(rnorm(n, mean=0,sd=1)) # for some large-ish n cumtest <- cumsum(testhist) cumref <- cumsum(refhist) plot(cumref

[R] Nlme not working on very similar initial values

2012-04-03 Thread Ramiro Barrantes
Hello, I am using CentOS Linux 6.0, R 2.14.1 and nlme 3.1-103 I am trying to fit some models using nlme, and what was happening was that it would get to some datasets and just "stall", the memory usage would grow and grow and eventually crash. I looked carefully into one of the datasets and ra

Re: [R] Calculating NOEL using R and logistic regression - Toxicology

2012-04-03 Thread Drew Tyre
OK, a bit of reading on Google / Wikipedia etc seems to indicate that there isn't a good definition of a NOEL, which makes advising a statistical approach dodgy at best. Your clarification raises all sorts of wrinkles, like how significant is significant, what's the background rate of adverse event

Re: [R] How does predict.loess work?

2012-04-03 Thread David Winsemius
On Apr 3, 2012, at 4:12 PM, Recher She wrote: Dear R community, I am trying to understand how the predict function, specifically, the predict.loess function works. I understand that the loess function calculates regression parameters at each data point in 'data'. lo <- loess ( y~x, data)

[R] Histogram from a table in R

2012-04-03 Thread gina_alessa
Hi all, I am new in R. I am trying to make an histogram but I can't figure it out. I have .cvs table with a lot of data that look like this: I already have the frequency of each interval (Counts). Interval Counts 00:19 0 10:19 3117 20:29 4500 30:39 2330...

Re: [R] Calculating NOEL using R and logistic regression - Toxicology

2012-04-03 Thread Drew Tyre
Is this the smallest observed dose that has an effect? If so, then you don't need the glm to find it. Here is a simulated example: set.seed(101) X = rep(1:10,each=10) lp = -5 + 0.5*X Y = rbinom(length(X),size=1,p=1/(1+exp(-lp))) # is this the NOEL? min(X[Y==1]) # picks out observations with advers

Re: [R] R equivalent for SQL query

2012-04-03 Thread Drew Tyre
As you can see there are lots of ways to get this done! But in vanilla R: test = data.frame(A=rep(1,6),B=c(1,1,1,2,2,3),C=1:6) with(test,aggregate(C,list(A,B),length)) does what you've asked, I think. On Tue, Apr 3, 2012 at 1:26 PM, Steven Raemaekers wrote: > Hi, > > I have a query which I would l

[R] Perspective Plot, and npreg

2012-04-03 Thread dnewbold
Hi, Im doing a simple non parametric regression using two variables(ie regressing one on the the other), how would I counstruct my persp plot for it with there only be two variables in total, . Any help would be much appreciated. -- View this message in context: http://r.789695.n4.nabble.com/Pers

[R] How does predict.loess work?

2012-04-03 Thread Recher She
Dear R community, I am trying to understand how the predict function, specifically, the predict.loess function works. I understand that the loess function calculates regression parameters at each data point in 'data'. lo <- loess ( y~x, data) p <- predict (lo, newdata) I understand that the pr

Re: [R] Italicize journal article in mid text

2012-04-03 Thread Jean V Adams
See ?plotmath For example, try this: plot(1, 1) mtext(expression(paste( "See Author1 and Author2 (2007), \"Title\", ", italic(Journal), " ", italic(of), " ", italic(Something), ", pp. 1-50."))) Jean lukevancleve wrote on 04/03/2012 01:10:06 PM: > Hi, > > I need to

[R] Off Topic: Re: Calculating NOEL using R and logistic regression - Toxicology

2012-04-03 Thread Bert Gunter
Below. -- Bert On Tue, Apr 3, 2012 at 1:47 PM, Danielle Duncan wrote: > Thanks for the response, I should have clarified that the NOEL is the > smallest dose above which there is a statistically significant effect. > This is not a scientifically meaningful nor defensible definition as it is stoch

Re: [R] Constructing Distance matrix for hclust

2012-04-03 Thread Jean V Adams
You posted this a week ago. Do you still need help with it? If so, can you give an example of what your mysql data look like? Have you brought your mysql data into R, or is that part of the question? Jean Vinod Hegde wrote on 03/27/2012 08:30:11 AM: > Hi, > > I have similarity value betwee

Re: [R] Calculating NOEL using R and logistic regression - Toxicology

2012-04-03 Thread Danielle Duncan
Thanks for the response, I should have clarified that the NOEL is the smallest dose above which there is a statistically significant effect. On Tue, Apr 3, 2012 at 12:44 PM, Drew Tyre wrote: > Is this the smallest observed dose that has an effect? If so, then you > don't need the glm to find it.

Re: [R] R equivalent for SQL query

2012-04-03 Thread David Winsemius
On Apr 3, 2012, at 3:26 PM, Steven Raemaekers wrote: I'm sorry, but I think that's just plain rude. This is exactly the reason why people do not like to ask for help on mailing lists and internet forums. The usual expectation on this list is for a questioner to demonstrate what was tried

Re: [R] Calculating NOEL using R and logistic regression - Toxicology

2012-04-03 Thread Danielle Duncan
Thanks, that is interesting, but what I'm really after is an easy "no observed effect level", using a binomial logistic model ie glm. Have a great day! On Mon, Apr 2, 2012 at 3:38 PM, vito.muggeo wrote: > dear Danielle, > > The NOEL is a threshold value or breakpoint in the range of dose. Have a

Re: [R] R equivalent for SQL query

2012-04-03 Thread Steven Raemaekers
I'm sorry, but I think that's just plain rude. This is exactly the reason why people do not like to ask for help on mailing lists and internet forums. The help file is full of valuable information, if you know exactly where to look. For someone who doesn't know this, it is rather more complicat

Re: [R] object of type 'S4' is not subsettable

2012-04-03 Thread phillen
Thanks for that hint. Philipp Lentner -- View this message in context: http://r.789695.n4.nabble.com/object-of-type-S4-is-not-subsettable-tp4529063p4529958.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing l

Re: [R] R equivalent for SQL query

2012-04-03 Thread jim holtman
Here is a solution using the data.table package: > x <- read.table(text = "A B C + 1 1 3 + 1 1 4 + 1 1 5 + 1 2 6 + 1 2 7 + 1 3 8", header = TRUE) > require(data.table) > x <- data.table(x) # convert to a data.tabl

Re: [R] R equivalent for SQL query

2012-04-03 Thread andrija djurovic
Hi, here are some solutions: DF <- read.table(textConnection(" A B C 1 1 3 1 1 4 1 1 5 1 2 6 1 2 7 1 3 8 "), header=TRUE) #using sqldf package library(sqldf) sqldf("select A, B, count(*) from DF group

Re: [R] ff usage for glm

2012-04-03 Thread Thomas Lumley
On Tue, Apr 3, 2012 at 1:42 AM, Benilton Carvalho wrote: > Did you try the example described on the ff man page? Also, the last error message you report happens when chunks of the data set give design matrices that don't line up correctly. You said you added one new variable, but there are actua

Re: [R] Create Model Object (setClass?setMethod?)

2012-04-03 Thread R. Michael Weylandt
Setting a class is quite easy if you are in the S3 (read: easier) system: x <- 1:15 class(x) <- "YourClass" summary.YourClass <- function(x, ...) cat("The mean of your object is ", mean(x), "\n") summary(x) Michael On Tue, Apr 3, 2012 at 12:54 PM, casperyc wrote: > Hi all, > > I have a self w

Re: [R] grouping

2012-04-03 Thread R. Michael Weylandt
Please take a look at my first reply to you: ave(y, findInterval(y, quantile(y, c(0.33, 0.66 Then read ?ave for an explanation of the syntax. ave takes two vectors, the first being the data to be averaged, the second being an index to split by. You don't want to use split() here. Michael On

Re: [R] np package problem

2012-04-03 Thread David Winsemius
On Apr 3, 2012, at 2:46 PM, dnewbold wrote: Hi, Im trying to run a non parametric regression and I wish to use function npreg(), I installed the np package, but I am being told that npreg doesnt exist. Any advice on how I could fix this? The usual error following that set of actions is us

Re: [R] grouping

2012-04-03 Thread Berend Hasselman
On 03-04-2012, at 20:21, Val wrote: > Hi All, > > On the same data points > x=c(46, 125 , 36 ,193, 209, 78, 66, 242 , 297,45 ) > > I want to have have the following output as data frame > > x group group mean > 46 142.3 > 125 289.6 > 36 142.3 >

Re: [R] object of type 'S4' is not subsettable

2012-04-03 Thread Duncan Murdoch
On 03/04/2012 12:42 PM, phillen wrote: Figured it out. given that object 'cit' is of class S4, extracting information works as follows: 1)finding out names of slots in object 'cit' > slotNames(cit) [1] "x" "Z0""Z1""ZK""type" "model" [7] "ecdet" "la

Re: [R] np package problem

2012-04-03 Thread R. Michael Weylandt
You need to load it once per session with library(np) Michael On Tue, Apr 3, 2012 at 2:46 PM, dnewbold wrote: > Hi, Im trying to run a non parametric regression and I wish to use function > npreg(), I installed the np package, but I am being told that npreg doesnt > exist. Any advice on how I co

Re: [R] grouping

2012-04-03 Thread Berend Hasselman
On 03-04-2012, at 21:02, Val wrote: > > > On Tue, Apr 3, 2012 at 2:53 PM, Berend Hasselman wrote: > > On 03-04-2012, at 20:21, Val wrote: > > > Hi All, > > > > On the same data points > > x=c(46, 125 , 36 ,193, 209, 78, 66, 242 , 297,45 ) > > > > I want to have have the following output as

Re: [R] Mixed italic and non-italic in text

2012-04-03 Thread David Winsemius
On Apr 3, 2012, at 2:05 PM, lukevancleve wrote: mtext( "See Author1 and Author2 (2007) , \"Title\", Journal of Something , pp. 1-50.", side = 3, outer = T, line=-0.75, cex = 0.7, at= 0.04, adj = 0, font = 1, family = "Times") ?plotmath # especially the italic function mtext(expressio

[R] np package problem

2012-04-03 Thread dnewbold
Hi, Im trying to run a non parametric regression and I wish to use function npreg(), I installed the np package, but I am being told that npreg doesnt exist. Any advice on how I could fix this? -- View this message in context: http://r.789695.n4.nabble.com/np-package-problem-tp4529813p4529813.htm

Re: [R] Question about randomForest

2012-04-03 Thread Saruman
I dont see how this answered the original question of the poster. He was quite clear: the value of the predictions coming out of RF do not match what comes out of the predict function using the same RF object and the same data. Therefore, what is predict() doing that is different from RF? Yes, RF

Re: [R] grouping

2012-04-03 Thread Val
On Tue, Apr 3, 2012 at 2:53 PM, Berend Hasselman wrote: > > On 03-04-2012, at 20:21, Val wrote: > > > Hi All, > > > > On the same data points > > x=c(46, 125 , 36 ,193, 209, 78, 66, 242 , 297,45 ) > > > > I want to have have the following output as data frame > > > > x group group mean

[R] Italicize journal article in mid text

2012-04-03 Thread lukevancleve
Hi, I need to italicize the journal in a citation but have thus far failed. How can I make 'Journal of Something' below italic but leave the rest plain? mtext( "See Author1 and Author2 (2007) , \"Title\", Journal of Something , pp. 1-50.", side = 3, outer = T, line=-0.75, cex = 0.7, at= 0.04

Re: [R] unable to move temporary installation

2012-04-03 Thread Drew Tyre
A final followup. I have identified a rather extreme workaround. The problem arises when the function utils:::unpackPkgZip uses file.rename(...) to move the unzipped binary package from the temporary directory that it was unpacked into into the proper directory in the library tree. If one does debu

[R] R equivalent for SQL query

2012-04-03 Thread Steven Raemaekers
Hi, I have a query which I would like to translate into R, but I do not know how to do it in an easy way. Assume a data frame has columns A, B and C: A B C 1 1 3 1 1 4 1 1 5 1 2 6 1 2 7 1 3 8 The query is as fol

[R] Mixed italic and non-italic in text

2012-04-03 Thread lukevancleve
Hi, I need to italicize the journal in a citation but have thus far failed. How can I make 'Journal of Something' below italic but leave the rest? mtext( "See Author1 and Author2 (2007) , \"Title\", Journal of Something , pp. 1-50.", side = 3, outer = T, line=-0.75, cex = 0.7, at= 0.04, adj =

Re: [R] grouping

2012-04-03 Thread Val
I did look at it the result is below, x=c(46, 125 , 36 ,193, 209, 78, 66, 242 , 297,45 ) #lapply( split(x, cut(x, quantile(x, prob=c(0, .333, .66 ,1)) , include.lowest=TRUE) ), mean) ave( split(x, cut(x, quantile(x, prob=c(0, .333, .66 ,1)) , include.lowest=TRUE) ), mean) > ave( split(x, cut(

Re: [R] filling small gaps of N/A

2012-04-03 Thread R. Michael Weylandt
Like I said in my followup, please pass the maxgap argument: i.e., na.approx(x, maxgap = 4) x <- zoo(1:20, Sys.Date() + 1:20) x[2:4] <- NA # Short run of NA's x[10:16] <- NA # Long run of NA's na.approx(x) # All filled in na.approx(x, maxgap = 4) # Only the short one filled in Michael On Tue,

Re: [R] grouping

2012-04-03 Thread Petr Savicky
On Tue, Apr 03, 2012 at 02:21:36PM -0400, Val wrote: > Hi All, > > On the same data points > x=c(46, 125 , 36 ,193, 209, 78, 66, 242 , 297,45 ) > > I want to have have the following output as data frame > > x group group mean > 46 142.3 > 125 289.6 > 36

Re: [R] grouping

2012-04-03 Thread Val
Hi All, On the same data points x=c(46, 125 , 36 ,193, 209, 78, 66, 242 , 297,45 ) I want to have have the following output as data frame x group group mean 46 142.3 125 289.6 36 142.3 193 3235.25 209 3235.25 78 2

[R] ff problems

2012-04-03 Thread Bond, Stephen
this works: bigcl <- read.table(file="bigCL1.csv",sep=',',header=T , colClasses=c(rep("factor",3),"numeric","NULL","integer", "numeric","integer","NULL","numeric","NULL"),nrow=1000) this doesn't: bigcl <- read.table.ffdf(file="bigCL1.csv",sep=',',header=T ,

Re: [R] filling small gaps of N/A

2012-04-03 Thread Gabor Grothendieck
On Tue, Apr 3, 2012 at 4:52 AM, jeff6868 wrote: > Hi everybody, > > I'm a new R french user. Sorry if my english is not perfect. Hope you'll > understand my problem ;) > > I have to work on temperature data (35000 lines in one file) containing some > missing data (N/A). Sometimes I have only 2 or

Re: [R] how to map microarray probe to gene, homology

2012-04-03 Thread Peter Langfelder
On Tue, Apr 3, 2012 at 7:21 AM, email mail wrote: > Hi: > > I have clustered microarray gene expression data and trying to map between > microarray probe, gene, pathway, gene ontology, and homology for a set of > (affy) microarray probes. Is there any package in R which facilitates this? > I am lo

Re: [R] time-series features skewness kurtosis periodicity trend seasonality

2012-04-03 Thread John Kohr
Thx for the link, I have seen these packages before, but looking to them, i couldn't find any that computes these statistics/measures. Any clue if any particular of them computes any of these characteristics? One of the co-authors of the paper is Prof. Hyndman who has contributed in many of th

Re: [R] Import from excel button in R-command

2012-04-03 Thread David Winsemius
On Apr 3, 2012, at 10:57 AM, nimoke wrote: Hello I have been searching for almost 2 hours for a certain plug-in/ package, so im making this thread as i hope you can help me find it. I had my first lesson in "Statistics in use" today, and when we worked on the school computers, we could d

Re: [R] filling small gaps of N/A

2012-04-03 Thread jim holtman
Forgot to mention that the offsets were into the 'gaps' (result of the rle) and 'offsets' which is the index into the original data there the gap starts. > gaps Run Length Encoding lengths: int [1:5] 2 2 4 14 2 values : logi [1:5] FALSE TRUE FALSE TRUE FALSE > offsets [1] 1 3 5 9 23 > On

Re: [R] filling small gaps of N/A

2012-04-03 Thread jim holtman
> x <- read.table(text="09/01/2008 12:00 1.93 + 09/01/2008 12:15 3.93 + 09/01/2008 12:30 NA + 09/01/2008 12:45 NA + 09/01/2008 13:00 4.93 + 09/01/2008 13:15 5.93 + 09/01/2008 16:152.93 + 09/01/2008 16:302.93 + 09/01/2008 16:45

Re: [R] time-series features skewness kurtosis periodicity trend seasonality

2012-04-03 Thread David Winsemius
On Apr 3, 2012, at 12:34 PM, John Kohr wrote: Hello everyone, I found the paper "A scalable method for time-series clustering" and there are proposed several measures to characterize time-series like trend, seasonality, periodicity, serial correlation, skewness, kurtosis, self-simila

Re: [R] time-series features skewness kurtosis periodicity trend seasonality

2012-04-03 Thread Thomas Adams
John, If the paper is the one by Xiaozhe Wang, Kate A. Smith, Rob Hyndman, and Damminda Alahakoon, the way I read it, it does not say they created an R package (that may be on CRAN). They may have just used R in their analyses; just a guess... Tom On Tue, Apr 3, 2012 at 12:34 PM, John Kohr wrote

Re: [R] identify time span in date vector

2012-04-03 Thread David Winsemius
On Apr 3, 2012, at 9:35 AM, Fischer, Felix wrote: Hello everyone, i try to identify the first element of a date vector, for which the following condition holds: at least 3 more dates within the next 365 days, but at least one of these must be between 3-12 month later. dates = as.Date(sor

Re: [R] How do you distinguish between characters on a pco plot?

2012-04-03 Thread Sarah Goslee
You can pass a vector of colors to the col= argument, eg col=c(1, 1, 2, 3, 2, 1) to match your parameters. Or, in your case, c(rep("blue", 3), rep("red", 4), rep(2, "green")) - untested because you didn't provide an example. You should read ?par and ?plot Unless you're using lattice graphics, but

[R] Create Model Object (setClass?setMethod?)

2012-04-03 Thread casperyc
Hi all, I have a self written likelihood as a model and functions to optimize and get fitted values, confidence intervals ect. I wonder if there is a way to define a 'class', or a 'model' (or a certain object)? so that I can use 'summary' to produce a summary like it does for a lm object. Also,

Re: [R] object of type 'S4' is not subsettable

2012-04-03 Thread phillen
Figured it out. given that object 'cit' is of class S4, extracting information works as follows: 1)finding out names of slots in object 'cit' > slotNames(cit) [1] "x" "Z0""Z1""ZK""type" "model" [7] "ecdet" "lag" "P" "season""dumvar

[R] Import from excel button in R-command

2012-04-03 Thread nimoke
Hello I have been searching for almost 2 hours for a certain plug-in/package, so im making this thread as i hope you can help me find it. I had my first lesson in "Statistics in use" today, and when we worked on the school computers, we could do this to import data from excel: Data > Import Dat

[R] conversion of Modified Julian Days to YMDHMS format

2012-04-03 Thread uday
Does anybody knows how to convert Modified Julian Days(MJD) to YMDHMS format? The sample data set which I have is as follows time <- c(1832.415 ,1832.415 ,1832.415 ,1832.415 ,1832.415 ,1832.415 ,1832.415, 1832.415, 1832.415 ,1832.415) which is Days since "1.1.2000" (in UT time, starting at 00:00:

[R] object of type 'S4' is not subsettable

2012-04-03 Thread phillen
hey there! The object 'cit' contains: > cit # # Johansen-Procedure Unit Root / Cointegration Test # # The value of the test statistic is: 5.3484 9.0681 10.6433 --- I want R to

Re: [R] filling small gaps of N/A

2012-04-03 Thread jeff6868
Michael, First of all, thank you very much for your answer. I've read your 2 answers, but I'm not really sure that they corresponds to my problem of NAs. I'll try to detail you a bit more. This problem concerns the second part of my program. In the first part, I've already created a timeseries ob

[R] identify time span in date vector

2012-04-03 Thread Fischer, Felix
Hello everyone, i try to identify the first element of a date vector, for which the following condition holds: at least 3 more dates within the next 365 days, but at least one of these must be between 3-12 month later. dates = as.Date(sort(rnorm(10,3000,100)), origin = "2000-1-1") Has anyone a

Re: [R] How do you distinguish between characters on a pco plot?

2012-04-03 Thread leannehaggerty
I've read everything I can find, maybe I'm just missing something but I can't find an example which colours the points on a pco plot differently based on user specified parameters, I can colour every point differently or all the same, or randomly with a number of colours. What I need to do is spec

[R] how to map microarray probe to gene, homology

2012-04-03 Thread email mail
Hi: I have clustered microarray gene expression data and trying to map between microarray probe, gene, pathway, gene ontology, and homology for a set of (affy) microarray probes. Is there any package in R which facilitates this? I am looking at bioconductor, but till now could not find a solution.

[R] time-series features skewness kurtosis periodicity trend seasonality

2012-04-03 Thread John Kohr
Hello everyone, I found the paper "A scalable method for time-series clustering" and there are proposed several measures to characterize time-series like trend, seasonality, periodicity, serial correlation, skewness, kurtosis, self-similarity etc. They say they have implemented them on R, do y

  1   2   >