Re: [R] Why can't R understand if(num!=NA)?

2013-05-04 Thread peter dalgaard
On May 3, 2013, at 21:36 , David Winsemius wrote: On May 3, 2013, at 10:46 AM, peter dalgaard wrote: Because comparison with an unknown value yields an unknown result. Anything else would violate the Second Law of Thermodynamics. We cannot have comparisons reducing entropy, now can

[R] plotting 2 time series data on the same graph

2013-05-04 Thread Preetam Pal
Hi all, I have 2 time series variables : X_t and Y_t where t=0,1,2,...,100 I want a plot containing the line charts( time plotted on the x-axis) for both these variables. -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year, Room No. N-114

[R] Multiple Line Plots in the same graph

2013-05-04 Thread Preetam Pal
Hi all, (Kindly ignore the previous mail.) I have 2 time series variables : X_t and Y_t where t=0,1,2,...,100 I want a plot containing the line charts( time plotted on the x-axis) for both these variables. How can I do this or where do I look for the information on this? Appreciate your

Re: [R] plotting 2 time series data on the same graph

2013-05-04 Thread Rui Barradas
Hello, Where is the reproducible example? See http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example Anyway, see if this does what you need. set.seed(1) x - cumsum(rnorm(100)) y - cumsum(rnorm(100)) ylm - range(c(x, y)) plot(as.ts(x), ylim = ylm) lines(y, col

Re: [R] Multiple Line Plots in the same graph

2013-05-04 Thread Berend Hasselman
On 04-05-2013, at 11:24, Preetam Pal lordpree...@gmail.com wrote: Hi all, (Kindly ignore the previous mail.) I have 2 time series variables : X_t and Y_t where t=0,1,2,...,100 I want a plot containing the line charts( time plotted on the x-axis) for both these variables. How can

Re: [R] plotting 2 time series data on the same graph

2013-05-04 Thread Rui Barradas
Hello, I forgot a third possibility plot(as.ts(cbind(x, y)), plot.type = single, col = 1:2) Rui Barradas Em 04-05-2013 10:37, Rui Barradas escreveu: Hello, Where is the reproducible example? See http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

Re: [R] significantly different from one (not zero) using lm

2013-05-04 Thread Elaine Kuo
Hello, Thanks. But the parameter offset is new to me. Please kindly explain why setting offset to x will give a significant test of whether the slope coefficient is different from one. (I checked the ?lm but still do not understand it well) Thanks again Elaine On Wed, May 1, 2013 at 11:12 AM,

[R] Lasso Regression error

2013-05-04 Thread Preetam Pal
Hi all, I have a data set containing variables LOSS, GDP, HPI and UE. (I have attached it in case it is required). Having renamed the variables as l,g,h and u, I wish to run a Lasso Regression with l as the dependent variable and all the other 3 as the independent variables.

[R] github_install problem

2013-05-04 Thread Halldór Björnsson
I am trying to use the github_install from the devtool package. I get the following error on install_github(roxygen): Peer certificate cannot be authenticated with given CA certificates This is probably some github security issue (and not strictly a devtools thing). Has anyone seen this

Re: [R] plotting 2 time series data on the same graph

2013-05-04 Thread arun
Hi, One more possibility: dateA-seq.Date(as.Date(1jan2012,format=%d%b%Y),as.Date(14Feb2013,format=%d%b%Y),by=day)   dateB-seq.Date(as.Date(1Mar2012,format=%d%b%Y),as.Date(30Nov2012,format=%d%b%Y),by=day) set.seed(15)  A-data.frame(dateA,value=cumsum(rnorm(411)))  set.seed(25)  

[R] Panel Granger Non-Causality Tests in R

2013-05-04 Thread londonphd
Hi, I was wondering if there is a package/function for Panel Granger non-causality tests? I am interested in Toda-Yamamoto like procedure for panel models. Thank you, -- View this message in context: http://r.789695.n4.nabble.com/Panel-Granger-Non-Causality-Tests-in-R-tp4666316.html Sent

Re: [R] Help, how to find the genes with A19?

2013-05-04 Thread arun
Hi, If it is to get the first 18 genes (based on rownumbers) dat1- read.table(apcall.txt,header=TRUE,sep=,stringsAsFactors=FALSE)  dat1[1:18,] #or dat1[as.numeric(rownames(dat1))19,] A.K. The row numbers represent 7129 different genes The 38 columns represent 38 different patients How can

Re: [R] Lasso Regression error

2013-05-04 Thread David Winsemius
On May 4, 2013, at 6:09 AM, Preetam Pal wrote: Hi all, I have a data set containing variables LOSS, GDP, HPI and UE. (I have attached it in case it is required). Having renamed the variables as l,g,h and u, I wish to run a Lasso Regression with l as the dependent variable and all the

Re: [R] Why can't R understand if(num!=NA)?

2013-05-04 Thread David Winsemius
On May 3, 2013, at 10:58 PM, peter dalgaard wrote: On May 3, 2013, at 21:36 , David Winsemius wrote: On May 3, 2013, at 10:46 AM, peter dalgaard wrote: Because comparison with an unknown value yields an unknown result. Anything else would violate the Second Law of

Re: [R] how to parallelize 'apply' across multiple cores on a Mac

2013-05-04 Thread Charles Berry
David Romano dromano at stanford.edu writes: Hi everyone, I'm trying to use apply (with a call to zoo's rollapply within) on the columns of a 1.5Kx165K matrix, and I'd like to make use of the other cores on my machine to speed it up. (And hopefully also leave more memory free: I find

Re: [R] significantly different from one (not zero) using lm

2013-05-04 Thread Jeff Newmiller
Parameters are different from functions, and offset is a function. Kindly read the help for that function and the references given there. --- Jeff NewmillerThe . . Go Live...

Re: [R] Factor deletion criteria

2013-05-04 Thread Greg Snow
In addition to David's great answer also read ?contr.SAS ?contr.treatment ?relevel and also sections 4 and 11.1.1 in An Introduction to R. On Fri, May 3, 2013 at 9:47 PM, David Winsemius dwinsem...@comcast.netwrote: On May 3, 2013, at 3:32 PM, Iuri Gavronski wrote: Hi, I would like to

Re: [R] Help, how to find the genes with A19?

2013-05-04 Thread arun
Hi, lst1-apply(dat1,1,table) res-which(unlist(lapply(lst1,function(x) {indx-names(x)%in%A; if(any(indx)) x[indx]19 else NA}),use.names=FALSE)) head(res) #[1] 19 39 40 41 43 45  length(res) #[1] 1481 lst1[c(19,39,40)] #$`19` # # A  P # 1 37 # #$`39` # # A  P #12 26 # #$`40` # # A  P #16 22

Re: [R] significantly different from one (not zero) using lm

2013-05-04 Thread Greg Snow
The offset(x) term means to include x (or whatever is in the parentheses) into the model as is, without computing a slope for that term. You could also include offset( 1 * x ) instead which might make this a bit more explicit (but would not actually make any difference). Since x by itself is

Re: [R] Lasso Regression error

2013-05-04 Thread Preetam Pal
Hi, I rectified my error (thanks David for pointing it out) Now I have been able to run the code: data=read.table(data.txt, header=T) l=data$LOSS h=data$HPI u=data$UE g=data$GDP matrix=cbind(g,h,u) lasso=lars(matrix,l) The final set of coefficients for the regression is the last row of

Re: [R] Help, how to find the genes with A19?

2013-05-04 Thread arun
Hi, You can get the table results in a matrix:  Unel-sort(unique(unlist(dat1)))  res2- t(mapply(function(x,y) ifelse(x %in% names(y),y[as.character(x)],0),list(Unel),lst1))  dimnames(res2)- list(rownames(dat1),Unel)  head(results) #   A M P #1 38 0 0 #2 38 0 0 #3 38 0 0 #4 34 2 2 #5 38 0 0 #6 38

[R] Plot smooth

2013-05-04 Thread Jose Narillos de Santos
Hi I have this data and I want to draw a plot of a line BUR the thing is I want that this line appear smooth ¿someone knows if there is an special function? Thanks in advance. Vertice 02/05/2013 1w 0,083 2w 0,092 3w 0,1 1m 0,113 2m 0,159 3m 0,201 4m 0,236 5m 0,272 6m 0,302 7m 0,333

Re: [R] how to parallelize 'apply' across multiple cores on a Mac

2013-05-04 Thread David Romano
(I neglected to use reply-all.) -- Forwarded message -- From: David Romano drom...@stanford.edu Date: Sat, May 4, 2013 at 11:25 AM Subject: Re: [R] how to parallelize 'apply' across multiple cores on a Mac To: Charles Berry ccbe...@ucsd.edu On Sat, May 4, 2013 at 9:32 AM,

Re: [R] Plot smooth

2013-05-04 Thread Jeff Newmiller
You ask for help with smooth lines, but show no indication what you are doing with this data. Where is your example code that plots this data with not-smooth lines? I think the HTML email has messed up your data anyway. Next time post plain text email (See the Posting Guide mentioned at the

[R] memory leak using 'apply'? [was: how to parallelize 'apply' across multiple cores on a Mac]

2013-05-04 Thread David Romano
Hi everyone, From the answers I've received to the question below, it occurs to me there may be more than inefficient programming on my part involved: The 'apply' code described below quickly takes up the 18 GB of memory I have available, which leaves my machine functioning at a crawl for the

Re: [R] Plot smooth

2013-05-04 Thread Jim Lemon
On 05/05/2013 04:23 AM, Jose Narillos de Santos wrote: Hi I have this data and I want to draw a plot of a line BUR the thing is I want that this line appear smooth ¿someone knows if there is an special function? Thanks in advance. Vertice 02/05/2013 1w 0,083 2w 0,092 3w 0,1 1m 0,113 2m

[R] Size of label axis

2013-05-04 Thread Jose Narillos de Santos
Hi all, I want to know if the is a possibility to increase the size of the default numbers that appears on axis on a plot, I don´t mean a labbel I mean the number on axis and yaxis. You see when in excel you select a plot and select all and increase the font letters or mark bold all the graph

[R] Error running caret's gbm train function with new version of caret

2013-05-04 Thread Katrina Bennett
I am running caret for model exploration. I developed my code a number of months ago and I've been running it with no issues. Recently, I updated my version of caret however, and now I am getting a new error. I'm wondering if this is due to the new release. The error I am getting is when I am

Re: [R] Size of label axis

2013-05-04 Thread David Winsemius
On May 4, 2013, at 3:24 PM, Jose Narillos de Santos wrote: Hi all, I want to know if the is a possibility to increase the size of the default numbers that appears on axis on a plot, I don´t mean a labbel I mean the number on axis and yaxis. You see when in excel you select a plot and

[R] Vegan problem

2013-05-04 Thread Gilson Carvalho
Hi All, I am trying to perform CCA and RDA several times to compare their performances. To do that I put this two functions of vegan package inside a for loop. Unfortunatly when I am trying to perform the anova(by=axis) to test the individual axes the function don't recognize the species

Re: [R] Vegan problem

2013-05-04 Thread Jari Oksanen
On 05/05/2013, at 03:05 AM, Gilson Carvalho wrote: I am trying to perform CCA and RDA several times to compare their performances. To do that I put this two functions of vegan package inside a for loop. Unfortunatly when I am trying to perform the anova(by=axis) to test the individual

Re: [R] Lasso Regression error

2013-05-04 Thread Preetam Pal
Thanks David for the paper, I understand the theory. But my question is about R only: the vector of coefficients that R outputs in lars(), does it apply against the original variable y or against (y-y_bar). I have put in intercept=T as well in my lars() model. I need this information to calculate