Re: [R] Extracting slots from an object (e.g.: object produced by unit root test function "urdfTest")

2015-03-12 Thread David Winsemius
On Mar 12, 2015, at 7:49 PM, jpm miao wrote: > Thank you very much. > > Could we extract the p-value in the output of the ur.df function? Does there > exist any unit root test function where the p-value can be extracted? Thanks! If this were an S3 function, it would be a fairly simple operati

Re: [R] automate "press enter"

2015-03-12 Thread Adams, Jean
Harold, This did the trick for my application, options(httr_oauth_cache=TRUE) See http://stackoverflow.com/questions/28221405/automated-httr-authentication-with-twitter-provide-response-to-interactive-pro for details. Jean On Thu, Mar 12, 2015 at 10:25 AM, Doran, Harold wrote: > I’m dealing

Re: [R] Extracting slots from an object (e.g.: object produced by unit root test function "urdfTest")

2015-03-12 Thread jpm miao
Sorry. Let me modify the question: Does there exist any unit root test function (with trend or intercept) where the p-value can be extracted? The function adf.test in tseries package does return the p-value, but there's no choice of trend or intercept. Thanks. 2015-03-13 10:49 GMT+08:00 jpm miao :

Re: [R] Extracting slots from an object (e.g.: object produced by unit root test function "urdfTest")

2015-03-12 Thread jpm miao
Thank you very much. Could we extract the p-value in the output of the ur.df function? Does there exist any unit root test function where the p-value can be extracted? Thanks! An example for ur.df function: data(Raotbl3) attach(Raotbl3) lc.df <- ur.df(y=lc, lags=3, type='trend') summary(lc.df)

Re: [R] Installing R on Linux Red Hat Server

2015-03-12 Thread MacQueen, Don
In contrast to using a package manager as others have suggested, you can download the "Source Code for all Platforms" from CRAN (currently R-3.1.3.tar.gz), unpack it somewhere, and follow the instructions in the INSTALL file. This has worked well for me. I don't advise one method in preference to

Re: [R] Installing R on Linux Red Hat Server

2015-03-12 Thread stephen sefick
Axel, I am running SL 6.5. I use EPEL for R related things without much hassle. FWIW, Stephen On Thu, Mar 12, 2015 at 3:39 PM, Axel Urbiz wrote: > Hello, > > My apologies if this is not the right place to post this question. > > I need to get R installed on a Linux Red Hat server. I have very l

Re: [R] regex find anything which is not a number

2015-03-12 Thread Adrian Dușa
On Thu, Mar 12, 2015 at 9:52 PM, John McKown wrote: > [...] > One problem is that Adrian wanted, for some reason, to exclude numbers > such as "2." but accept "2.0" . That is, no unnecessary trailing > decimal point. as.numeric() will not fail on "2." since that is a > number. The example grep() s

Re: [R] .Rdata files -- fortune?

2015-03-12 Thread Jeff Newmiller
I was positive I knew WTF I was doing until you set me straight, Rolf. ;-) --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...

[R] Lagged Covariate

2015-03-12 Thread Mahesh Samtani
I am doing some mixed effects modeling where we would like to test the hypothesis that the dependent variable (Dependent.var) as a function of time depends on the value of the covariate 6 months to a year earlier. The difficulty is that not all subjects have measurements every 6 months (as shown be

Re: [R] write.csv to text string?

2015-03-12 Thread Thomas Nyberg
(Forgot to CC my response to the list...) Thanks a lot this is exactly what I'm looking for! This is how I'll probably use it... > a cola colb 112 223 > f <- textConnection("s_a", "w") > write.csv(a, f, row.names=F) > close(f) # Next do something with s_a...

Re: [R] write.csv to text string?

2015-03-12 Thread Thomas Nyberg
I just wanted to send one final message out about this. My previous post technically works, but is quite slow with large files/strings. I've decided instead to do it exactly in the way that I was trying to avoid. So just to set the record straight, these are the functions I'm going to be using (the

Re: [R] Installing R on Linux Red Hat Server

2015-03-12 Thread peter dalgaard
> On 12 Mar 2015, at 21:39 , Axel Urbiz wrote: > > Hello, > > My apologies if this is not the right place to post this question. The R-sig-Fedora list is rather more densely packed with people who know about redhat/fedora. > I need to get R installed on a Linux Red Hat server. I have very l

Re: [R] Installing R on Linux Red Hat Server

2015-03-12 Thread Sarah Goslee
"Use your package manager" seems like a good place to start. Googling "install R redhat" seems like another good starting point. I think for RedHat you'll probably want the EPEL repo. Sarah On Thu, Mar 12, 2015 at 4:39 PM, Axel Urbiz wrote: > Hello, > > My apologies if this is not the right pl

Re: [R] Installing R on Linux Red Hat Server

2015-03-12 Thread Marc Schwartz
> On Mar 12, 2015, at 3:39 PM, Axel Urbiz wrote: > > Hello, > > My apologies if this is not the right place to post this question. > > I need to get R installed on a Linux Red Hat server. I have very limited > exposure to R and would appreciate some basic guidance if you could point > me to re

Re: [R] write.csv to text string?

2015-03-12 Thread peter dalgaard
Or, more in line with what was asked: con <- textConnection("foo", "w") write.csv(file=con, airquality) close(con) foo It does, incidentally, look possible to equip write.table (of which write.csv is a special case) with an intern=TRUE setting, which could effectively do the above internally an

[R] Installing R on Linux Red Hat Server

2015-03-12 Thread Axel Urbiz
Hello, My apologies if this is not the right place to post this question. I need to get R installed on a Linux Red Hat server. I have very limited exposure to R and would appreciate some basic guidance if you could point me to resources describing the process, requirements, etc. Thank you in adv

Re: [R] .Rdata files -- fortune?

2015-03-12 Thread Rolf Turner
On 12/03/15 19:38, PIKAL Petr wrote: On Wed, Mar 11, 2015 at 09:00:15AM -0400, Prof J C Nash (U30A) wrote: Personally I think that auto saving / restoring workspaces should be reviewed, as it can, in practice, make it harder for people to render their work in a self-contained and reproduc

[R] Using choiceDes Package to Design MaxDiff?

2015-03-12 Thread Vik Rubenfeld
I’m seeking to design a MaxDiff experiment that will have a number of blocks of this type: Which of these items is the most important? Which of these items is the least important? Item 1 Item 2 Item 3 Item 4 I’m seeking to use the choiceDes package

Re: [R] regex find anything which is not a number

2015-03-12 Thread John McKown
On Thu, Mar 12, 2015 at 2:43 PM, Steve Taylor wrote: > How about letting a standard function decide which are numbers: > > which(!is.na(suppressWarnings(as.numeric(myvector > > Also works with numbers in scientific notation and (presumably) different > decimal characters, e.g. comma if that's

Re: [R] regex find anything which is not a number

2015-03-12 Thread Steve Taylor
How about letting a standard function decide which are numbers: which(!is.na(suppressWarnings(as.numeric(myvector Also works with numbers in scientific notation and (presumably) different decimal characters, e.g. comma if that's what the locale uses. -Original Message- From: R-help

Re: [R] write.csv to text string?

2015-03-12 Thread Rui Barradas
Hello, Maybe using text connections. See ?textConnection. tc <- textConnection("foo", "w") s <- 'cola,colb\n1,2\n2,3\n' cat(s, file = tc) close(tc) foo read.csv(text = foo) Hope this helps, Rui Barradas Em 12-03-2015 17:15, Thomas Nyberg escreveu: Hello, I've found the following useful fu

Re: [R] write.csv to text string?

2015-03-12 Thread David Winsemius
On Mar 12, 2015, at 10:15 AM, Thomas Nyberg wrote: > Hello, > > I've found the following useful functionality: > >> s <- 'cola,colb\n1,2\n2,3\n' >> read.csv(text=s) > cola colb > 112 > 223 > > > But I haven't found a similar option in write.csv. I.e. I would like to > "write"

Re: [R] write.csv to text string?

2015-03-12 Thread Sarah Goslee
It's really not a job for the write.* functions, but for the string-handling functions. Here's a slightly clunky possibility: # use your example s.df <- read.csv(text='cola,colb\n1,2\n2,3\n') # turn a data frame into a string paste( paste(colnames(s.df), collapse=","), paste(apply(s.df, 1,

[R] write.csv to text string?

2015-03-12 Thread Thomas Nyberg
Hello, I've found the following useful functionality: > s <- 'cola,colb\n1,2\n2,3\n' > read.csv(text=s) cola colb 112 223 But I haven't found a similar option in write.csv. I.e. I would like to "write" a dataframe to a string. What would be the easiest way to go about such a t

Re: [R] Extracting slots from an object (e.g.: object produced by unit root test function "urdfTest")

2015-03-12 Thread David Winsemius
On Mar 12, 2015, at 1:04 AM, jpm miao wrote: > Hi, > > I run a statistical test function in the package "fUnitRoots" that > returns a S4 object but I am wondering how to extract the p-value, one of > the output elements. > The document of the function "urdfTest": > . > All tests return an

Re: [R] .Rdata files -- fortune?

2015-03-12 Thread Jan Kim
Dear Petr, dear All, On Thu, Mar 12, 2015 at 06:38:40AM +, PIKAL Petr wrote: > Hi > > > -Original Message- > > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jan Kim > > Sent: Wednesday, March 11, 2015 4:44 PM > > To: r-help@r-project.org > > Subject: Re: [R] .Rdata f

[R] Help with error: arguments imply differing number of rows

2015-03-12 Thread Aman Gill
Hello, I am stuck trying to run an analysis using the package picante. I am running two very similar analyses. One works as expected, but when I try the other, I get the error: Error in data.frame(PD = PDs, SR = SR) : arguments imply differing number of rows: 34, 35 This is strange to me since

Re: [R] automate "press enter"

2015-03-12 Thread William Dunlap
Poke around the help files (& perhaps source code) for package:httr to see how to set options("httr_oauth_cache"). E.g., help(package="httr", "Token-class") Bill Dunlap TIBCO Software wdunlap tibco.com On Thu, Mar 12, 2015 at 8:25 AM, Doran, Harold wrote: > I’m dealing with an issue that

[R] automate "press enter"

2015-03-12 Thread Doran, Harold
I�m dealing with an issue that is seemingly simple, and I�m sure there is an obvious solution. I�m writing a wrapper function that calls functions from another package (twitteR). However, the function I happen to be using in that package prompts the user the user to enter a �1� or a �2� in the

Re: [R] Relation of BLAS and LAPACK

2015-03-12 Thread Prof Brian Ripley
On 12/03/2015 13:43, Tomáš Greif wrote: How BLAS and LAPACK are related, does R need both? Both. I am trying to understsand different BLAS options in R and I am quite not sure if LAPACK is part of BLAS, or separate library or something else. Based on http://www.netlib.org/lapack/ it looks li

Re: [R] How to filter data using sets generated by flattening with dcast, when I can't store those sets in a data frame

2015-03-12 Thread William Dunlap
In base R you can do what I think you want with aggregate() and Filter(). E.g., > a <- aggregate(df["Day"], df["ID"], function(x)x) > str(a) 'data.frame': 3 obs. of 2 variables: $ ID : num 1 2 3 $ Day:List of 3 ..$ 1: num 1 2 4 7 ..$ 5: num 2 3 ..$ 7: num 1 3 4 8 >

[R] Relation of BLAS and LAPACK

2015-03-12 Thread Tomáš Greif
How BLAS and LAPACK are related, does R need both? I am trying to understsand different BLAS options in R and I am quite not sure if LAPACK is part of BLAS, or separate library or something else. Based on http://www.netlib.org/lapack/ it looks like LAPACK is some kind of BLAS extension ("LAPACK ro

[R] [R-pkgs] New package: clifro (v2.4-0)

2015-03-12 Thread Blake Seers
Dear R Users, I am pleased to inform you that my clifro package has been submitted to CRAN today: http://cran.r-project.org/web/packages/clifro/ The clifro package imports data from New Zealand's National Climate Database (via CliFlo) and provides generic plotting methods for a range of the vari

Re: [R] .Rdata files -- fortune?

2015-03-12 Thread PIKAL Petr
Hi > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jan Kim > Sent: Wednesday, March 11, 2015 4:44 PM > To: r-help@r-project.org > Subject: Re: [R] .Rdata files -- fortune? > > On Wed, Mar 11, 2015 at 09:00:15AM -0400, Prof J C Nash (U30A) wrote: > > W

Re: [R] Introductory courses in R in Denmark?

2015-03-12 Thread david montaner
Dear Johan >From GENOMETRA we organize this kind of courses on demand In a couple of weeks we are running one in Valencia: http://www.genometra.com/cursos/curso_r_2015_03/ Sorry that in this case the program is in Spanish. If your can find a group of people interested on the course we can go t

[R] Introductory courses in R in Denmark?

2015-03-12 Thread Johan Lassen
Dear R-forum! I would like to hear if someone know off some good introductory classes in Denmark? E.g. one week course with teaching in basic R (how to read/export in data into/from R with emphasis on txt, csv. and database, how to do basic operations on data frames and vectors, how to plot data a

Re: [R] R can't find tcl-tk

2015-03-12 Thread peter dalgaard
> On 11 Mar 2015, at 20:05 , MacQueen, Don wrote: > > What is the result of > > capabilities()['tcltk'] > > ? - and did the configure actually succeed, tcl-wise? Should be near the end of the output in, like Interfaces supported: X11, aqua, tcltk Also notice that if you run R on a

Re: [R] tcltk problem

2015-03-12 Thread peter dalgaard
Fixed in R-devel. As a curiosity, this seems to have been there the last 7 years without anyone noticing. And the change to tcl() is another 4.5 years older... The problem with \dontrun sections in examples is that they tend not to be run... -pd On 12 Mar 2015, at 09:17 , Erich Neuwirth wro

Re: [R] How to filter data using sets generated by flattening with dcast, when I can't store those sets in a data frame

2015-03-12 Thread David Barron
Most of this question is over my head, I'm afraid, but looking at what I think is the crux of your question, couldn't you achieve the results you want in two steps, like this: dta <- data.frame(ID=c(1,1,1,1,2,2,3,3,3,3), Day=c(1,2,4,7,2,3,1,3,4,8),Pain=c(10,9,7,2,8,7,10,6,6,2)) l1 <- tapply(dta$D

[R] Using choiceDes Package to Design MaxDiff?

2015-03-12 Thread Vik Rubenfeld
I’m seeking to design a MaxDiff experiment that will have a number of blocks of this type: Which of these items is the most important? Which of these items is the least important? Item 1 Item 2 Item 3 Item 4 I’m seeking to use the choiceDes package

Re: [R] Adding Column to a Data Frame

2015-03-12 Thread David L Carlson
The merge function combines 2, not 3 files at a time. Maybe rich.stats2 = merge(rich.stats, Month, by="X.SampleID") rich.stats3 = merge(rich.stats2, Location, by="X.SampleID") Reading the manual page will help: ?merge - David L Carlson Department of Anthropol

Re: [R] .Rdata files -- fortune?

2015-03-12 Thread Jan Kim
On Wed, Mar 11, 2015 at 09:00:15AM -0400, Prof J C Nash (U30A) wrote: > Well put. I avoid them too, and go so far as to seek and destroy so they > don't get loaded unnoticed and cause unwanted consequences. > > ".RData files (the ones with nothing before the period) are just traps > for your futur

Re: [R] Annoyance with %/%

2015-03-12 Thread William Dunlap
> %/% which, BTW, > violated the sacred rule that for all a, and non-zero b: > > a = b * (a %/% b) + a %% b > > Namely, that Inf %/% n is not Inf, but NaN. But the other sacred rule is that a%%b is >=0 and (1 + 2^53) %% 2 # 1 if you had infinite precision [1] 0 > (2 + 2^53) %% 2 [1] 0 War

Re: [R] tcltk problem

2015-03-12 Thread Karim Mezhoud
Hi, Here same working example. http://mcu.edu.tw/~chenmh/teaching/project/r/reference/RTclTkExamples/ Best, Karim On Wed, Mar 11, 2015 at 10:41 PM, Erich Neuwirth < erich.neuwi...@univie.ac.at> wrote: > OSX 10.10.2 > R 3.1.3 > XQuartz installed. > > I am trying to run one of the tcltk demos > Thi

[R] R-studio stalls in arulesSequences

2015-03-12 Thread Simon Givoli
Hi, I'm trying to extract sequences from my data, using the SPADE algorithm in the arulesSequences package: 1 1 8 1100 31 45 31 45 1 5 1200 1 2 100 1100 31 45 1 5 31 1 3 59 1100 31 45 1 81 1000 1 1 5 1 4 69 1100 31 45 17 1000 610 1000 1 1 81 1 5 31 1100 31 45 81 1000 (library(Matrix (library(aru

[R] (no subject)

2015-03-12 Thread Simon Givoli
Hi, I'm trying to extract sequences from my data, using the SPADE algorithm in the arulesSequences package: 1 1 8 1100 31 45 31 45 1 5 1200 1 2 100 1100 31 45 1 5 31 1 3 59 1100 31 45 1 81 1000 1 1 5 1 4 69 1100 31 45 17 1000 610 1000 1 1 81 1 5 31 1100 31 45 81 1000 (library(Matrix (library(aru

Re: [R] tcltk problem

2015-03-12 Thread Erich Neuwirth
Sorry, I get at these demo when I do ?tkscrollbar Then the help file for many of the UI widgets appears, titled TkWidgets {tcltk} On the bottom of this file are the 2 examples I mentioned. Excuse the incomplete description in the first and the incorrect description in the second message. > On

[R] .Rdata files -- fortune?

2015-03-12 Thread Prof J C Nash (U30A)
Well put. I avoid them too, and go so far as to seek and destroy so they don't get loaded unnoticed and cause unwanted consequences. ".RData files (the ones with nothing before the period) are just traps for your future self, with no documentation. I avoid them like the plague." JN On 15-03-11

Re: [R] tcltk problem

2015-03-12 Thread Erich Neuwirth
Thesw are demos for tclscrollbar I copied them from the help file to the console manually as the help file suggested. > On 12 Mar 2015, at 09:04, peter dalgaard wrote: > >> >> On 11 Mar 2015, at 23:41 , Erich Neuwirth > > wrote: >> >> OSX 10.10.2 >> R 3.1.3 >

Re: [R] problem applying the same function twice

2015-03-12 Thread Curtis Burkhalter
Sarah, This strategy works great for this small dataset, but when I attempt your method with my data set I reach the maximum allowable memory allocation and the operation just stalls and then stops completely before it is finished. Do you know of a way around this? Thanks On Tue, Mar 10, 2015 at

Re: [R] tcltk problem

2015-03-12 Thread peter dalgaard
> On 11 Mar 2015, at 23:41 , Erich Neuwirth wrote: > > OSX 10.10.2 > R 3.1.3 > XQuartz installed. > > I am trying to run one of the tcltk demos Which demos? Doesn't look like any the ones in the package. (Please at least be specific when you imply that someone is publishing bad code.) > Th

Re: [R] problem applying the same function twice

2015-03-12 Thread William Dunlap
The key to your problem may be that x<-apply(missing,1,genRows) converts 'missing' to a matrix, with the same type for all columns then makes x either a list or a matrix but never a data.frame. Those features of apply may mess up the rest of your calculations. Don't use apply(). Bill Dunlap T

[R] Extracting slots from an object (e.g.: object produced by unit root test function "urdfTest")

2015-03-12 Thread jpm miao
Hi, I run a statistical test function in the package "fUnitRoots" that returns a S4 object but I am wondering how to extract the p-value, one of the output elements. The document of the function "urdfTest": . All tests return an object of class "fHTEST" with the following slots: @call ...

[R] How to filter data using sets generated by flattening with dcast, when I can't store those sets in a data frame

2015-03-12 Thread Jocelyn Ireson-Paine
This is a fairly long question. It's about a problem that's easy to specify in terms of sets, but that I found hard to solve in R by using them, because of the strange design of R data structures. In explaining it, I'm going to touch on the reshape2 library, dcast, sets, and the non-orthogonali