[R] Incoherence between arima.sim and auto.arima

2009-09-29 Thread Giusy
Hello, I have a question about function arima.sim I tried to somulate a AR(1) process, with no innovation, no error term. I used this code: library(forecast) e=rnorm(100,mean=0,sd=0) series=arima.sim(model=list(ar=0.75),n=100,innov=e)+20 Then I tried to applicate ti this series auto.arima functi

Re: [R] preformatted and '#' in manual pages

2009-09-29 Thread Duncan Murdoch
Gábor Csárdi wrote: Dear All, I have the following in a .Rd file: ... human readable (not binary) format. The format itself is like the following: \preformatted{ \# vertex1name vertex2name [optionalWeight] vertex3name [optionalWeight] } Here,

Re: [R] Probability of data values form DENSITY function

2009-09-29 Thread Meyners, Michael, LAUSANNE, AppliedMathematics
Lina, check whether something like data.frame(density(rnorm(10))[1:2]) contains the information you want. Otherwise, try to be (much) more specific in what you want so that we do not need to guess (and of course provide minimal, self-contained, reproducible code). That has a higher chance to t

Re: [R] ggplot2 box plot notches

2009-09-29 Thread ONKELINX, Thierry
Dear Steve, I don't think that ggplot2 has that option. Hadley, please correct me if I'm wrong. HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel

Re: [R] overwritten plots in pdf file

2009-09-29 Thread baptiste auguie
Hi, Try opening and closing the device outside the loop, pdf("D:/research/plot.pdf") for (i in 1:n) { plot(mon, mu, type ='o') } dev.off() HTH, baptiste __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do re

[R] Probability of data values form DENSITY function

2009-09-29 Thread Lina Rusyte
Hello,   Could someone help me please and to tell how to get the probability from empirical DENSITY (not parametric) for each data value (R function). For example, for normal distribution there is such a function like:   “dnorm(q, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE)” Â

[R] Problem installing RMAGEML package

2009-09-29 Thread Mamun Rashid
Hi all, I ran in to a problem while trying to install RMAGEML package. /usr/bin/ld: cannot find -ljava . (please look at the bottom for details of the error) I have set the following in ~/.bashrc file. export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64 export LD_LIBRARY_PATH=/ho

[R] overwritten plots in pdf file

2009-09-29 Thread CJ Rubio
i am having a problem in saving plots in pdf. i have this code below and it only shows me the last plot. i tried keeping my devices open by removing dev.off() from the code but the pdf file won't open for (i in 1:n) { . . . pdf("D:/research/plot.pdf") plot(mon, mu, type ='o') dev.off() } my for

[R] Comparing vectors from lists

2009-09-29 Thread Christina Rodemeyer
Hi guys, I still did not solve my problem properly! I have to compare the values of two lists of 250 numbers as a result of using the ?by function! List1 of 250  $ 0   : num [1:28] 22 11 31...  $ 1   : num [1:15] 12 14 9 ... .. .. ..  - attr(*, "dim")= int 250  - attr(*, "dimnames")=List of 1 L

Re: [R] sort dates within a factor

2009-09-29 Thread hadley wickham
On Tue, Sep 29, 2009 at 6:58 AM, wrote: > Apologies for the misunderstanding. I can come up with a solution that might > suit your needs: > > library(plyr) > out <- ddply(test, .(nr), function(x) data.frame(date=x$date, > index=rank(-as.integer(x$date > out[is.na(out$nr) | is.na(out$date),

[R] ggplot2 box plot notches

2009-09-29 Thread stvienna wiener
Dear List, I just googled to find out if notched box plots are possible with ggplot2, but couldn't find a answer to it. boxplot() has the option: notch = TRUE, e.g.: boxplot(mpg$hwy, notch=TRUE) My example code (taken from the net) is: require(ggplot2) qplot(class, hwy, fill=factor(year), data

Re: [R] C++

2009-09-29 Thread Steve Lianoglou
On Sep 29, 2009, at 8:39 AM, Dirk Eddelbuettel wrote: On Tue, Sep 29, 2009 at 05:27:54AM -0700, Stefo Ratino wrote: Hello, I have written a C++ code and I would like to use it in R! Is this possible? Yes, see e.g. http://cran.r-project.org/package=Rcpp And section 5 of the "Writing R Ex

Re: [R] How to parsing data like this in R

2009-09-29 Thread Henrique Dallazuanna
Try this: Str <- ":[Anna 'moi =) akku loppu joskus 4ltä. Kestää kauan nää..'\tAmer, Tuusula (0:20)\t20\t12\t16\t00\t00\t11]/Anne 'Ei jakoa,uus päivä muistio et 4n niin peruin. Hups'\t (0:16)\t0\t12\t18\t00\t00\t11/Elina 'Konsertissa. En tod. vastaa teille'\tEtu-Töölö, Helsinki (2:40)\t24\t12\t18\t

Re: [R] Cannot allocate memory of size x on Linux - what's the solution?

2009-09-29 Thread Dave Wood
Thanks for the responses @Patrik Burns I'm going to try running on a 64 bit machine. Unfortunately R isn't installed properly on it yet and our admin guy is away, so it'll have to wait. @ Uwe Ligges Unless the program suddenly starts generating masses and masses of data, I don't think this is t

[R] Data source for American college football rankings?

2009-09-29 Thread Douglas Bates
An interesting, and topical, example of multivariate data for classroom illustrations are the American college football rankings. Starting at the end of October (or "week 8", the 8th week of the football season) a set of rankings called the BCS (Bowl Championship Series) will be published. This is

[R] How to parsing data like this in R

2009-09-29 Thread Tammy Ma
Hi, R-users, I met a problem: Items:[Anna 'moi =) akku loppu joskus 4ltä. Kestää kauan nää..'\tAmer, Tuusula (0:20)\t20\t12\t16\t00\t00\t11]/Anne 'Ei jakoa,uus päivä muistio et 4n niin peruin. Hups'\t (0:16)\t0\t12\t18\t00\t00\t11/Elina 'Konsertissa. En tod. vastaa teille'\tEtu-Töölö, Helsink

Re: [R] R and REST API's

2009-09-29 Thread Gary Lewis
Thanks to all of you who replied. You've provided some great leads. I really appreciate it. Gary On Mon, Sep 28, 2009 at 10:01 AM, Gary Lewis wrote: > Hi - Many organizations now make their data available as XML via a > REST web service architecture. Is there any R package or facility to > acce

Re: [R] C++

2009-09-29 Thread Dirk Eddelbuettel
On Tue, Sep 29, 2009 at 05:27:54AM -0700, Stefo Ratino wrote: > Hello, > > I have written a C++ code and I would like to use it in R! Is this possible? Yes, see e.g. http://cran.r-project.org/package=Rcpp Dirk -- Three out of two people have difficulties with fractions. __

Re: [R] [Rd] Probability of data values form empirical distribution

2009-09-29 Thread John Nolan
The function ecdf(x) computes the empirical cdf from data in the vector x. You can plot it with plot(ecdf(x)), or compute the emp. cdf at new values, e.g. my.cdf <- ecdf(x) my.cdf( 0:3 ) # computes the emp. cdf at 0,1,2,3 John .

[R] C++

2009-09-29 Thread Stefo Ratino
Hello, I have written a C++ code and I would like to use it in R! Is this possible? Many thanks in advance, Stepho [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] A programming question - is what I want to do possible in R?

2009-09-29 Thread jim holtman
Add a dummy argument to the function: >> randomSamples<-lapply(1:2000,function(dummy){ > + meta_comp[sample(nrow(meta_comp),nTimes),]}) On Mon, Sep 28, 2009 at 9:39 PM, ewaters wrote: > > Thanks for your help. > > Unfortunately when I try it this generates an error as follows: > >> randomSamples

Re: [R] sort dates within a factor

2009-09-29 Thread xavier . chardon
Apologies for the misunderstanding. I can come up with a solution that might suit your needs: library(plyr) out <- ddply(test, .(nr), function(x) data.frame(date=x$date, index=rank(-as.integer(x$date out[is.na(out$nr) | is.na(out$date), "index"] <- NA Xavier - Mail Original - De: "

Re: [R] preformatted and '#' in manual pages

2009-09-29 Thread Gábor Csárdi
Uwe, thanks, but this does not help, I still get: LaTeX errors when creating PDF version. This typically indicates Rd problems. LaTeX errors found: ! You can't use `macro parameter character #' in vertical mode. ...ike the following: \begin {alltt} ##

Re: [R] sort dates within a factor

2009-09-29 Thread Stefan Uhmann
Hi Xavier, thank you for your suggestion, it's not exactly what I need. However I made some progress using tapply, but it does not give me the 'correct' result (see index - that's what I want to obtain!) when NAs are involved: test <- data.frame(date = as.Date(c('2007-01-01','2008-03-24','NA'

Re: [R] preformatted and '#' in manual pages

2009-09-29 Thread Uwe Ligges
From Writing R Extensions: "‘#’, ‘_’ and ‘&’ must not be escaped." Uwe Ligges Gábor Csárdi wrote: Dear All, I have the following in a .Rd file: ... human readable (not binary) format. The format itself is like the following: \preformatted{ \# vertex1name

Re: [R] Cannot allocate memory of size x on Linux - what's the solution?

2009-09-29 Thread Uwe Ligges
davew wrote: Hi all, I'm running an analysis with the random forest tool. It's being applied to a data matrix of ~60,000 rows and between about 40 and 200 columns. I get the same error with all of the data files (Cannot allocate vector of size 428.5MB). I found dozens of threads regardi

Re: [R] some simple questions regarding survival analysis

2009-09-29 Thread johannes rara
2) See packages Epi and epitools -Johannes 2009/9/29 Dmitry Gospodaryov : > I have two types of survival data for Drosophila > cohort. For example: > > uncensored > >> age <- c (0, 2, 4, 6, 8, 10) >> alive1 <- c(10, 9, 6, 3, 1, 0) >> alive 2 <- c(10, 9, 4, 1, 1, 0) > > and censored > >> age <- c(

Re: [R] Create column of frequency

2009-09-29 Thread Chuck Cleland
On 9/29/2009 6:06 AM, abdul kudus wrote: > Dear all, > > Given mypi > mypi <- c(0.1,0.2,0.2,0.1,0.3,0.4,0.4,0.4,0.4,0.2) > > I want to create myfreq as follows > > mypi myfreq > 0.1 2 > 0.2 3 > 0.2 3 > 0.1 2 > 0.3 1 > 0.4 4 > 0.4 4 > 0.4 4 > 0.4 4 > 0.2 3 > > where myfreq is frequency of its co

[R] Comparing regression lines

2009-09-29 Thread Marcin Kozak
Hi, How would you compare several (simple) regression lines in R? Have you heard of any implementation of the Johnson-Neyman procedure or anything of this sort? Any suggestions? Best, Marcin __ R-help@r-project.org mailing list https://stat.ethz.ch/mai

[R] Probability of data values form empirical distribution

2009-09-29 Thread Lina Rusyte
Hello,   Could someone help me please and to tell how to get the probability from empirical distribution (not parametric) for each data value (R function). For example, for normal distribution there is such a function like:   “pnorm(q, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE)”  

[R] Create column of frequency

2009-09-29 Thread abdul kudus
Dear all, Given mypi mypi <- c(0.1,0.2,0.2,0.1,0.3,0.4,0.4,0.4,0.4,0.2) I want to create myfreq as follows mypi myfreq 0.1 2 0.2 3 0.2 3 0.1 2 0.3 1 0.4 4 0.4 4 0.4 4 0.4 4 0.2 3 where myfreq is frequency of its corresponding observation. How to do that? Thank you, Regards, A. Kudus Institu

Re: [R] sort dates within a factor

2009-09-29 Thread xavier . chardon
Is this what you want? test[order(test$nr, -as.integer(test$date)),] Xavier - Mail Original - De: "Stefan Uhmann" À: r-help@r-project.org Envoyé: Mardi 29 Septembre 2009 11h27:20 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne Objet: [R] sort dates within a factor De

[R] preformatted and '#' in manual pages

2009-09-29 Thread Gábor Csárdi
Dear All, I have the following in a .Rd file: ... human readable (not binary) format. The format itself is like the following: \preformatted{ \# vertex1name vertex2name [optionalWeight] vertex3name [optionalWeight] } Here, the first vertex of a

[R] Cannot allocate memory of size x on Linux - what's the solution?

2009-09-29 Thread davew0000
Hi all, I'm running an analysis with the random forest tool. It's being applied to a data matrix of ~60,000 rows and between about 40 and 200 columns. I get the same error with all of the data files (Cannot allocate vector of size 428.5MB). I found dozens of threads regarding this problem, but

[R] fft with NA values

2009-09-29 Thread Steve Jones
Hi List, I'm trying to perform some spectral analysis on a time series, but I've got a few data points missing, so they have NA values. Unfortunately, the fft function doesn't seem to like this, and gives a completely empty result. Other than making up values to fill in the gaps, is there any way

[R] time series and ACF

2009-09-29 Thread Kon Knafelman
Hey guys, im sort of a beginner with R, but here's what i need to do. i need to perform a time series analysis on a set of financial data that i've been given. im trying to look at the ACF and PACF and fit it to a particular model (i think its the ARIMA model because i've read that financial d

[R] sort dates within a factor

2009-09-29 Thread Stefan Uhmann
Dear List, I have the following data: >> test <- data.frame(date = as.Date(c('2007-01-01','2008-03-24','2003-03-02','2008-05-03','2002-05-23','2001-06-30','2005-12-04')), nr = c(2000,2000,2000,2001,2002,2003,2003)) test date nr 1 2007-01-01 2000 2 2008-03-24 2000 3 2003-03-02

Re: [R] error while plotting

2009-09-29 Thread Uwe Ligges
Nair, Murlidharan T wrote: -Original Message- From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de] Sent: Sunday, September 27, 2009 1:17 PM To: Nair, Murlidharan T Cc: r-help@r-project.org Subject: Re: [R] error while plotting Nair, Murlidharan T wrote: I am getting the foll

Re: [R] Running an ANOVA with a BY

2009-09-29 Thread xavier . chardon
Or with plyr there's a more flexible approach: res.aov <- dlply(warpbreaks, .(tension), function(x) aov(breaks ~ wool, data=x)) # aov results are stored in a list, you can directly extract what you want with l*ply l_ply(res.aov, function(x) print(summary(x))) ldply(res.aov, function(x) data.fram

Re: [R] Something wrong with my function Please Help

2009-09-29 Thread Jim Lemon
On 09/29/2009 01:29 PM, Chunhao Tu wrote: Hi R users, I try to build a function to compute odds ratio and relative risk however something wrong. I stuck for many hours but I really don't know how to solve it. Would someone please give me a hint? OR.RR<-function(x){ + x<- as.mat

Re: [R] plot error -- figure margins too large

2009-09-29 Thread Uwe Ligges
Ping-Hsun Hsieh wrote: Hi, I am trying to plot my dataset, consisting of one column with numeric values and one column with group IDs. The set is similar to the following df. df <- NULL for ( i in 1:20) { tmp1 <- runif(1000,0,5) tmp2 <- cbind(tmp1,i) df <- rbind(df,tmp2) } Now I woul

[R] some simple questions regarding survival analysis

2009-09-29 Thread Dmitry Gospodaryov
I have two types of survival data for Drosophila cohort. For example: uncensored age <- c (0, 2, 4, 6, 8, 10) alive1 <- c(10, 9, 6, 3, 1, 0) alive 2 <- c(10, 9, 4, 1, 1, 0) and censored age <- c(0, 2, 4, 6, 8, 10) alive1 <- c(10, 8, 3, 1, 1, 0) escaped1 <- c(0, 1, 1, 0, 0, 0) alive2 <- c(10

Re: [R] Something wrong with my function Please Help

2009-09-29 Thread Corrado
Did you run debug over your function? Load the library debug, and then run mtrace over your function. library(debug) ? mtrace hth On Tuesday 29 September 2009 04:29:37 Chunhao Tu wrote: > Hi R users, > I try to build a function to compute odds ratio and relative risk however > something wrong.

Re: [R] Something wrong with my function Please Help

2009-09-29 Thread Paul Hiemstra
Chunhao Tu wrote: Hi R users, I try to build a function to compute odds ratio and relative risk however something wrong. I stuck for many hours but I really don't know how to solve it. Would someone please give me a hint? OR.RR<-function(x){ + x <- as.matrix(any(dim(x)==2)) +

Re: [R] Something wrong with my function Please Help

2009-09-29 Thread Barry Rowlingson
On Tue, Sep 29, 2009 at 4:29 AM, Chunhao Tu wrote: > > Hi R users, > I try to build a function to compute odds ratio and relative risk however > something wrong. I stuck for many hours but I really don't know how to solve > it. Would someone please give me a hint? > >> OR.RR<-function(x){ What i

[R] Something wrong with my function Please Help

2009-09-29 Thread Chunhao Tu
Hi R users, I try to build a function to compute odds ratio and relative risk however something wrong. I stuck for many hours but I really don't know how to solve it. Would someone please give me a hint? > OR.RR<-function(x){ + x <- as.matrix(any(dim(x)==2)) + OR<-(x[1,1]*x[2,2])/(x[1

Re: [R] Data Step: Outer Join Rows, Inner Join Columns

2009-09-29 Thread Christian Schulz
Hi, if you like to use sql you can use the sqldf package. Another possibility is the basic function merge. HTH Christian > Hi, > > how can I do a data step in R which can be best described in SQL terminology > as an outer join of rows (eg cases) and inner join of columns (variables)? In >

Re: [R] A programming question - is what I want to do possible in R?

2009-09-29 Thread ewaters
Thanks for your help. Unfortunately when I try it this generates an error as follows: > randomSamples<-lapply(1:2000,function(){ + meta_comp[sample(nrow(meta_comp),nTimes),]}) Error in FUN(1:2000[[1L]], ...) : unused argument(s) (1:2000[[1]]) jholtman wrote: > > nTime <- 15 # how many samp

Re: [R] re trieve user input from an tcl/tk interface

2009-09-29 Thread jverzani
einsundeins gmail.com> writes: > > > Hello everyone, > > this is my first post here and I hope I signed up correctly and someone will > take me by the hand and help me out. I am new to R and cannot figure out > what to do here... > > ... I want to have an User Interface that requests input. I

[R] Data Step: Outer Join Rows, Inner Join Columns

2009-09-29 Thread schimpanski
Hi, how can I do a data step in R which can be best described in SQL terminology as an outer join of rows (eg cases) and inner join of columns (variables)? In case of conflicting non-missing values the first dataset has higher always priority. Missing values should always be replaced by valid v

<    1   2