Re: [R] Bar Chart

2011-03-24 Thread Jim Lemon
On 03/24/2011 03:26 AM, blutack wrote: How do you do a bar chart of 2 vectors? I have one vector which has 10 numbers, and another which has 10 names. The numbers are the frequency of the corresponding name, but when I do a bar chart it says that there is no height. Thanks. Hi blutack (any

Re: [R] Comparing non nested models with correlation coefficients (inspired from Lorch and Myers )

2011-03-24 Thread Boris New
Thank you very much for your answers. The problem is that the editor wants a formal test. So I guess that the Vuong test should be ok... 2011/3/24 Thomas Lumley tlum...@uw.edu On Thu, Mar 24, 2011 at 8:26 AM, Brian S Cade ca...@usgs.gov wrote: As a follow-up to Greg's suggested graphical

Re: [R] Comparing non nested models with correlation coefficients (inspired from Lorch and Myers )

2011-03-24 Thread Dieter Menne
Boris New wrote: The problem is that the editor wants a formal test. So I guess that the Vuong test should be ok... I frequently note that it is the big boss who believes that the editor wants a formal test. Nobody ever got fired for producing a p-value :-( Dieter -- View this message

[R] About proportional odds ratio model with LASSO in ordinal regression

2011-03-24 Thread Jheng-Jhong Wang
Dear R-users, I try to fit proportional odds ratio model with LASSO in ordinal regression. But I just find as below: glmnet package which used in Binomail and Multinomail response. glmnetcr package which used in contiuation-Ratio Logits model. Does someone know a package and/or

Re: [R] confirmatory factor analysis program in R

2011-03-24 Thread yrosseel
the cfa() function is in the 'lavaan' package -- View this message in context: http://r.789695.n4.nabble.com/confirmatory-factor-analysis-program-in-R-tp3386133p3401847.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] binary exogenous variable in path analysis in sem or lavaan

2011-03-24 Thread yrosseel
Rob, If 'sex' is indeed an exogenous variable (ie. predictor only), you can simply code it as (1=male, 2=female) and use it as a covariate in any sem model. In lavaan, you can explicitly use the argument 'fixed.x=TRUE', which will regard all exogenous covariates as fixed variables. Their

[R] Problems with predict in fGarch

2011-03-24 Thread Luis Felipe Parra
Hello. I am using fGarch to estimate the following model: Call: garchFit(formula = fmla, data = X[, i], trace = F) Mean and Variance Equation: data ~ arma(1, 1) + garch(1, 1) Conditional Distribution: norm Coefficient(s): mu ar1 ma1 omegaalpha1 beta1 -0.94934

Re: [R] Comparing non nested models with correlation coefficients (inspired from Lorch and Myers )

2011-03-24 Thread Jim Lemon
On 03/24/2011 06:30 PM, Dieter Menne wrote: ... Nobody ever got fired for producing a p-value :-( Oh, fortune, fortune! Or an R-squared! Jim __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] JRI execution problem

2011-03-24 Thread wesley mathew
Dear All I don't know is this right place to ask this question. I made one program in R environment and now I need to call that program from the from the java application using JRI package. I tried in both eclipse and java compiler but the Rengine re = new Rengine(args, false, new TextConsole());

[R] Extract the names of the arguments in an expression

2011-03-24 Thread Javier López-de-Lacalle
Hi everybody: I need to get the names of the arguments in an object of class expression. I've got the following expression: x - expression(rho * cos(omega)) Is there any function or procedure that returns the names of the arguments (in the example: rho and omega)? I tried a rough approach

[R] Problem with Snowball RWeka

2011-03-24 Thread AlexB84
Dear Forum, when I try to use SnowballStemmer() I get the following error message: Could not initialize the GenericPropertiesCreator. This exception was produced: java.lang.NullPointerException It seems to have something to do with either Snowball or RWeka, however I can't figure out, what to

Re: [R] recommended reading for manual maximum likelihood of a system of equations

2011-03-24 Thread Arne Henningsen
Hi Alex On 24 March 2011 04:47, Alex Olssen alex.ols...@gmail.com wrote: I am looking for some recommended reading. I want to read up on the estimation systems of linear equations using maximum likelihood? For a comprehensive review of estimating systems of linear equations, see:

[R] fraction with timelag

2011-03-24 Thread Patrick Hausmann
Dear r-help, I'm having this DF df - data.frame(id = 1:6, xout = c(1234, 2134, 234, 456, 324, 345), xin= c(NA, 34,67,87,34, NA)) and would like to calculate the fraction (xin_t / xout_t-1) The result should be: # NA, 2.76, 3.14, 37.18, 7.46, NA I am sure

Re: [R] Problem with Snowball RWeka

2011-03-24 Thread Mike Marchywka
Date: Thu, 24 Mar 2011 03:35:31 -0700 From: kont...@alexanderbachmann.de To: r-help@r-project.org Subject: [R] Problem with Snowball RWeka Dear Forum, when I try to use SnowballStemmer() I get the following error message: Could not initialize

Re: [R] fraction with timelag

2011-03-24 Thread Bill.Venables
How about simply df - data.frame(id = 1:6, + xout = c(12.34, 21.34, 2.34, 4.56, 3.24, 3.45), + xin = c(NA, 34,67,87,34, NA)) with(df, c(NA, xin[-1]/xout[-length(xout)])) [1]NA 2.755267 3.139644 37.179487 7.456140NA BTW You seem to

Re: [R] Extract the names of the arguments in an expression

2011-03-24 Thread Duncan Murdoch
On 11-03-24 5:03 AM, Javier López-de-Lacalle wrote: Hi everybody: I need to get the names of the arguments in an object of class expression. I've got the following expression: x- expression(rho * cos(omega)) Is there any function or procedure that returns the names of the arguments (in the

[R] Collapsing/aggregating columns in a matrix

2011-03-24 Thread Barth B. Riley
Dear list I want to know if there is a function in R that enables one to create a new matrix based on values in an existing matrix, whereby each column in the new matrix is a row-specific summary (e.g., sum, mean) of multiple columns in the original matrix. For instance, to take a 12-column

[R] Two matrix loop

2011-03-24 Thread Stefan Petersson
Hi, I'm trying to create a distance matrix. And it works out somewhat ok. However, I suspect that there are some efficiency issues with my efforts. Plz have a look at this: donor - matrix(c(3,1,2,3,3,1,4,3,5,1,3,2), ncol=4) receiver -

Re: [R] Extract the names of the arguments in an expression

2011-03-24 Thread Kenn Konstabel
I tried this as an exercise and here's what I arrived to: collector - function(expr){ RES - list() foo - function(x) unlist(lapply(x, as.list)) EXPR - foo(expr) while(length(EXPR) 0){ if(is.symbol(EXPR[[1]])){ RES - c(RES, EXPR[[1]]) EXPR - EXPR[-1]

Re: [R] ) Error in eval(expr, envir, enclos) : object '' not found

2011-03-24 Thread David Winsemius
On Mar 23, 2011, at 5:35 PM, mipplor wrote: exactly, i dont know why the header are separated by invisible periods. and it only happen to the header. If it continues as a problem, it because you have not followed my advice from yesterday. -- View this message in context:

Re: [R] Extract the names of the arguments in an expression

2011-03-24 Thread Gabor Grothendieck
2011/3/24 Javier López-de-Lacalle javier.lopezdelaca...@ehu.es: Hi everybody: I need to get the names of the arguments in an object of class expression. I've got the following expression: x - expression(rho * cos(omega)) Is there any function or procedure that returns the names of the

Re: [R] various plotting options

2011-03-24 Thread Michael Friendly
On 3/23/2011 10:27 AM, Grossmann Patrick wrote: Dear R-Project helpdesk member, I am currently working on some basic correspondence analysis using the R packages 'ca'. As I compute the CA by example- ca(data), and plotting example via plot(example), I am trying to figure out, how to get

Re: [R] Extract the names of the arguments in an expression

2011-03-24 Thread Duncan Murdoch
An improvement on my suggestion using codetools is to use codetools::findGlobals(f, merge=FALSE) which separates the functions and variables: $functions [1] * cos $variables [1] omega rho This is important, because R distinguishes between functions and variables by usage when it is doing

Re: [R] Collapsing/aggregating columns in a matrix

2011-03-24 Thread Ista Zahn
Hi Barth, Use rowMeans() like this: mat - matrix(rnorm(100), ncol=10) cbind(sum1.5 = rowSums(mat[,1:5]), sum2.6 = rowSums(mat[,2:6])) Best, Ista On Thu, Mar 24, 2011 at 12:10 PM, Barth B. Riley bbri...@chestnut.org wrote: Dear list I want to know if there is a function in R that enables one

[R] subset and as.POSIXct / as.POSIXlt oddness

2011-03-24 Thread Michael Bach
Dear R users, Given this data: x - seq(1,100,1) dx - as.POSIXct(x*900, origin=2007-06-01 00:00:00) dfx - data.frame(dx) Now to play around for example: subset(dfx, dx as.POSIXct(2007-06-01 16:00:00)) Ok. Now for some reason I want to extract the datapoints between hours 10:00:00 and

Re: [R] ) Error in eval(expr, envir, enclos) : object '' not found

2011-03-24 Thread mipplor
thx , i have solved this by sep=, -- View this message in context: http://r.789695.n4.nabble.com/Error-in-eval-expr-envir-enclos-object-not-found-tp3399503p3402403.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org

Re: [R] subset and as.POSIXct / as.POSIXlt oddness

2011-03-24 Thread David Winsemius
On Mar 24, 2011, at 9:29 AM, Michael Bach wrote: Dear R users, Given this data: x - seq(1,100,1) dx - as.POSIXct(x*900, origin=2007-06-01 00:00:00) dfx - data.frame(dx) Now to play around for example: subset(dfx, dx as.POSIXct(2007-06-01 16:00:00)) Ok. Now for some reason I want to

[R] Help needed with plot axis labeling

2011-03-24 Thread Thomas Adams
I have looked at many examples and tried many different combinations of doing this, but with no luck. I have something like this: plot(1:10, xaxt = n) axis(1, xaxp=c(2, 9, 7)) axis(4) but, what I need is to have different labels for axis-4 than those for axis-2 (the vertical axes) — that is,

Re: [R] subset and as.POSIXct / as.POSIXlt oddness

2011-03-24 Thread Michael Bach
Hi David, your approach selects the datapoints between 2007-06-01 10:00:00 and 2007-06-01 14:00:00 true enough. However, my real dataset is for several months and years. So I need data points between 10:00:00 and 14:00:00 only - independent of the date. I thought the name for that is aggregating.

Re: [R] Help needed with plot axis labeling

2011-03-24 Thread Sarah Goslee
Thomas, You need to specify both the labels and the desired location: plot(1:10, xaxt = n) axis(1, xaxp=c(2, 9, 7)) axis(4, labels=c(A, B, C, D, E), at=seq(2, 10, by=2)) You want the labels at 2,4,6,8,10 so you need to specify that, not 1:5. Sarah On Thu, Mar 24, 2011 at 9:55 AM, Thomas Adams

[R] Ctree Model Variables

2011-03-24 Thread jdanielnd
Hello! I am not familiar to deal with S4 objects in R, so this question can be stupid, but I hope I can get an answer. :P I'm trying to extract what are the response and explanatory variables from a Binary Tree and Random Forest. I could already extract the response variable from a Binary Tree

Re: [R] subset and as.POSIXct / as.POSIXlt oddness

2011-03-24 Thread Kenn Konstabel
On Thu, Mar 24, 2011 at 1:29 PM, Michael Bach pha...@gmail.com wrote: Dear R users, Given this data: x - seq(1,100,1) dx - as.POSIXct(x*900, origin=2007-06-01 00:00:00) dfx - data.frame(dx) Now to play around for example: subset(dfx, dx as.POSIXct(2007-06-01 16:00:00)) Ok. Now for

[R] questions regarding stat_smooth in ggplot area plot

2011-03-24 Thread jovian
Hello, I drew a simple area plot using ggplot2 using set - read.table(file=http://www.jovian.nl/set.csv;, head=1, sep=,) library(ggplot2) ggplot() + layer( data = set, mapping = aes(x = time, y = hours), geom = area, stat=smooth, color=red ) + layer( data = set, mapping = aes(x = time, y

[R] R CMD build creates tar file instead of tar.gz file

2011-03-24 Thread Ian Schiller
Dear all, I'm trying to create my own package by following for instance http://epub.ub.uni-muenchen.de/6175/2/tr036.pdf In step 6 (page 19) it says that the command 'R CMD build mypackage' should result in a tar.gz file. However, after running the command I end up with a tar file only (no gz

Re: [R] subset and as.POSIXct / as.POSIXlt oddness

2011-03-24 Thread Jeff Newmiller
On 03/24/2011 06:29 AM, Michael Bach wrote: Dear R users, Given this data: x- seq(1,100,1) dx- as.POSIXct(x*900, origin=2007-06-01 00:00:00) dfx- data.frame(dx) Now to play around for example: subset(dfx, dx as.POSIXct(2007-06-01 16:00:00)) Ok. Now for some reason I want to extract the

Re: [R] R CMD build creates tar file instead of tar.gz file

2011-03-24 Thread Duncan Murdoch
On 24/03/2011 10:36 AM, Ian Schiller wrote: Dear all, I'm trying to create my own package by following for instance http://epub.ub.uni-muenchen.de/6175/2/tr036.pdf In step 6 (page 19) it says that the command 'R CMD buildmypackage' should result in a tar.gz file. However, after running the

Re: [R] predict.rpart help

2011-03-24 Thread Terry Therneau
Make your own copy of predict.rpart: mypredict - rpart:::predict.rpart (Even better to grab the source code version, then you can start with a copy that has comments in it!) Edit it to add type='where': about 1/3 of the way down you will see that the routine has computed a variable where; that

Re: [R] subset and as.POSIXct / as.POSIXlt oddness

2011-03-24 Thread Hadley Wickham
On Thu, Mar 24, 2011 at 8:29 AM, Michael Bach pha...@gmail.com wrote: Dear R users, Given this data: x - seq(1,100,1) dx - as.POSIXct(x*900, origin=2007-06-01 00:00:00) dfx - data.frame(dx) Now to play around for example: subset(dfx, dx as.POSIXct(2007-06-01 16:00:00)) Ok. Now for

Re: [R] subset and as.POSIXct / as.POSIXlt oddness

2011-03-24 Thread Michael Bach
@Kenn: Yeah I have a way of loosing concentration when fiddling around and trying to get it work. Thanks for pointing out that I supplied a third argument when I wanted an additional test in the second argument instead. Also my selection choices indeed do not make any sense, no wonder your parser

Re: [R] subset and as.POSIXct / as.POSIXlt oddness

2011-03-24 Thread Michael Bach
I wanted to point out that this is a little easier to express with the lubridate package: subset(dfx, dx ymd(2007-06-01) hour(dx) 14 hour(x) 10) Thanks, will have a look at it.. but I presume you meant: subset(dfx, dx ymd(2007-06-01) hour(dx) 10 hour(x) 14) You are

[R] write all the permutations of a set

2011-03-24 Thread Arnau Mir
Hello. Somebody knows how to write in R all the permutations of a given set? For example, is the set is {a,b,c} I want the following: a,b,c a,c,b b,c,a b,a,c c,a,b c,b,a Thanks, Arnau. Arnau Mir Torres Edifici A. Turmeda Campus UIB

Re: [R] subset and as.POSIXct / as.POSIXlt oddness

2011-03-24 Thread David Winsemius
On Mar 24, 2011, at 10:02 AM, Michael Bach wrote: Hi David, your approach selects the datapoints between 2007-06-01 10:00:00 and 2007-06-01 14:00:00 true enough. However, my real dataset is for several months and years. So I need data points between 10:00:00 and 14:00:00 only -

Re: [R] write all the permutations of a set

2011-03-24 Thread Bernd Weiss
Am 24.03.2011 11:28, schrieb Arnau Mir: Hello. Somebody knows how to write in R all the permutations of a given set? For example, is the set is {a,b,c} I want the following: a,b,c a,c,b b,c,a b,a,c c,a,b c,b,a library(gregmisc) permutations(3, 3, letters[1:3]) gives [,1] [,2] [,3] [1,]

Re: [R] Comparing non nested models with correlation coefficients (inspired from Lorch and Myers )

2011-03-24 Thread Greg Snow
Well this starts veering towards fortune(194) and fortune(218). Though I did one time receive a response from an editor and reviewers asking for fewer p-values in favor of more confidence intervals. I was excited that someone was willing to move in that direction (unfortunately, that

Re: [R] Installing rJava fails

2011-03-24 Thread jcheng liu
Dear Orvalho Augusto, Thanks for your response. But we met a new problem. We set as waht you said in the last email and run installing agian. But we got the error: rJava.h:22:17: error: jni.h: No such file or directory. Actually we had found jni.h under {JAVA_HOME}/../include and the path had

Re: [R] subset and as.POSIXct / as.POSIXlt oddness

2011-03-24 Thread Gabor Grothendieck
On Thu, Mar 24, 2011 at 9:29 AM, Michael Bach pha...@gmail.com wrote: Dear R users, Given this data: x - seq(1,100,1) dx - as.POSIXct(x*900, origin=2007-06-01 00:00:00) dfx - data.frame(dx) Now to play around for example: subset(dfx, dx as.POSIXct(2007-06-01 16:00:00)) Ok. Now for

Re: [R] R CMD build creates tar file instead of tar.gz file

2011-03-24 Thread Ian Schiller
Thanks for your prompt answer Mr. Ripley. It appears the version of tar I'm using is exactly the same as the one included in the latest Rtools. I noticed that the Rtools/bin directory was not first in path, so I corrected this. However, I'm still not able to create a tar.gz file with the R

Re: [R] R CMD build creates tar file instead of tar.gz file

2011-03-24 Thread Uwe Ligges
On 24.03.2011 17:36, Ian Schiller wrote: Thanks for your prompt answer Mr. Ripley. It appears the version of tar I'm using is exactly the same as the one included in the latest Rtools. I noticed that the Rtools/bin directory was not first in path, so I corrected this. However, I'm still

Re: [R] R CMD build creates tar file instead of tar.gz file

2011-03-24 Thread Ian Schiller
Oh Sorry Mr Murdoch! I read a post where both you and Brian Ripley were involved and the confusion probably arose from that! Ok thanks Mr Ligges. Ian ** IAN SCHILLER,

Re: [R] R CMD build creates tar file instead of tar.gz file

2011-03-24 Thread Ian Schiller
Although Brian Ripley is faster at most things than I am, in this case I was more prompt than him. My mistake. I'm sorry! I don't know the CRAN policy on this, but I think it would be worthwhile fixing the problem you can see, in case there are other problems that you can't see. Agree.

Re: [R] R CMD build creates tar file instead of tar.gz file

2011-03-24 Thread Ian Schiller
A couple of things to try: - try re-installing Rtools and R - put Rcmd.bat from http://batchfiles.googlecode.com on your path and then try re-building Rcmd.bat build mypackage Rcmd.bat will automatically find R and certain other files from the registry and temporarily set certain environment

Re: [R] R CMD build creates tar file instead of tar.gz file

2011-03-24 Thread Ian Schiller
Ok guys. First thanks again for your help. It is very appreciated. Now here's the thing. I downloaded the Rcmd.bat and included in the path. I've also changed the location of the package source and ran R CMD build mypackage (Rcmd.bat is not working so I assume there is something I'm doing

Re: [R] R CMD build creates tar file instead of tar.gz file

2011-03-24 Thread Ian Schiller
You likely have the Hide extensions options enabled on your Windows system. Yes you're right! Guys, I thank you all for your precious help! Ian ** IAN SCHILLER, M.Sc.

Re: [R] R CMD build creates tar file instead of tar.gz file

2011-03-24 Thread Ian Schiller
(Rcmd.bat is not working so I assume there is something I'm doing wrong) I'd just like to let everyone knows that Rcmd.bat IS working properly after all. I had messed with the PATH environmental variable. In fact, like Gabor Grothendieck pointed out to me, one can just copy the Rcmd.bat file

Re: [R] R CMD build creates tar file instead of tar.gz file

2011-03-24 Thread Prof Brian Ripley
For the record, you can avoid all the Cygwin tar problems in 2.13.0 by setting the environment variable TAR to 'internal': you most likely do not even need Rtools. You may get other issues, though (especially from Cygwin and permissions), which is why it is not the default yet on Windows.

[R] Help with creating a ts (time series) object with daily sampling values

2011-03-24 Thread Pamela Allen
Hi All, I have a data set of daily measurements of river flow. I would like to create a “ts” object from this data. Here’s a sample data set: date - as.Date(c(1:300), format=%Y) year=as.numeric(format(date, format = %Y)) month=as.numeric(format(date, format = %m))

Re: [R] Ctree Model Variables

2011-03-24 Thread Achim Zeileis
On Thu, 24 Mar 2011, jdanielnd wrote: Hello! I am not familiar to deal with S4 objects in R, so this question can be stupid, but I hope I can get an answer. :P I'm trying to extract what are the response and explanatory variables from a Binary Tree and Random Forest. I could already extract

[R] apply mean to a three-dimension data

2011-03-24 Thread Hui Du
Hi All, Suppose I have data like b[[1]] = matrix(1:4, 2, 2) b[[2]] = matrix(10:13, 2, 2) b[[3]] = matrix(20:23, 2, 2) [[1]] [,1] [,2] [1,]13 [2,]24 [[2]] [,1] [,2] [1,] 10 12 [2,] 11 13 [[3]] [,1] [,2] [1,] 20 22 [2,] 21 23

[R] apply mean to a three-dimension data

2011-03-24 Thread Hui Du
Hi All, Suppose I have data like [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] R CMD build creates tar file instead of tar.gz file

2011-03-24 Thread Duncan Murdoch
On 24/03/2011 12:36 PM, Ian Schiller wrote: Thanks for your prompt answer Mr. Ripley. Although Brian Ripley is faster at most things than I am, in this case I was more prompt than him. It appears the version of tar I'm using is exactly the same as the one included in the latest Rtools.

[R] Millisecond TimeStamps

2011-03-24 Thread Madaliso Mulaisho
I am wondering if there is a good way to work with data that is indexed in time, via timestamps with a resolution in milliseconds. As I understand it, the POSIX classes have a resolution i n terms of seconds, and will not process fractional seconds from a string. Is this correct. I realize that

[R] Storing user-defined R functions

2011-03-24 Thread David.Epstein
Hello, I don't want to find out how to make packages unless that becomes necessary. Also, I don't want to clog up the computer memory with functions that I'm not using. (It would be great if someone in this forum would explain how memory is used when I type library(MASS) and then use only one

Re: [R] R CMD build creates tar file instead of tar.gz file

2011-03-24 Thread Gabor Grothendieck
On Thu, Mar 24, 2011 at 1:28 PM, Ian Schiller ian.schil...@clinepi.mcgill.ca wrote: Ok guys.  First thanks again for your help.  It is very appreciated.  Now here's the thing.  I downloaded the Rcmd.bat and included in the path.  I've also changed the location of the package source and ran R

Re: [R] Comparing non nested models with correlation coefficients (inspired from Lorch and Myers )

2011-03-24 Thread Bert Gunter
Yes, yes statisticians. But just remember that this is a plague that we have visited on ourselves. And continue to -- just peruse practically any statistical journal. (People who live in grass houses shouldn't stow thrones) Cheers, Bert (To non-native English speakers: my apologies for the bad

Re: [R] R CMD build creates tar file instead of tar.gz file

2011-03-24 Thread Gabor Grothendieck
On Thu, Mar 24, 2011 at 12:36 PM, Ian Schiller ian.schil...@clinepi.mcgill.ca wrote: Thanks for your prompt answer Mr. Ripley.  It appears the version of tar I'm using is exactly the same as the one included in the latest Rtools.  I noticed that the Rtools/bin directory was not first in path,

[R] Questions for domist... subscript out of bounds

2011-03-24 Thread jessiecy2001
Hi all, I am a new user for R. I faced a questions about subscript out of bounds. Although I checked some other helps before I sent this email, I still don't know how to deal with this problems. I want to use domain function to run species distribution model in R. I used

[R] Longitudinal categorical response data

2011-03-24 Thread Rasanga Ruwanthi
Dear List,   I have some longitudinal data, each patient was followed at times 0, 12, 16, 24 weeks and measure severity of a illness (0-worse, 1-same, 2-better). So, longitudinal response is categorical.  I was wondering whether lmer in R can fit a model for this type of data. If so, how we

[R] Colour makes my life; but not my bwplot (panel.violin)

2011-03-24 Thread JP
Using Trellis, am successfully setting up a number of panels (25) in which I have two box and violin plots. I would like to colour - one plot as RED and the other as BLUE (in each panel). I can do that with the box plots, but the violin density areas just take on one colour. My basic call is as

[R] debug R device plot

2011-03-24 Thread Michael Bach
Hi there, I was doing great with R, ggplot and tikzDevice, when suddenly it stopped working. I can do a plot just fine on the R online graphics device. I can also open a tikzdevice via tikz(). However, the plot (both ggplot and R graphics plot) call leads to the error: createLockFile(lockname):

[R] Help with creating a ts (time series) object with daily sampling values

2011-03-24 Thread Pamela Allen
Hi All, I have a data set of daily measurements of river flow. I would like to create a ts object from this data. Here's a sample data set: date - as.Date(c(1:300), format=%Y) year=as.numeric(format(date, format = %Y)) month=as.numeric(format(date, format = %m))

[R] How create vector that sums correct responses for multiple subjects?

2011-03-24 Thread Kevin Burnham
I have a data file with indicates pretest scores for a linguistics experiment. The data are in long form so for each of 33 subjects there are 400 rows, one for each item on the test, and there is a column called ‘Correct’ that shows ‘C’ for a correct response and ‘E’ for an incorrect response. I

Re: [R] Estimating correlation in multiple measures data

2011-03-24 Thread Michal Figurski
Peter, Regarding 1) I do not agree. See the following, simplified example: x - data.frame(ID=rep(1:2, each=4), Visit=rep(c(1:4), 2), ptA=c(7,8,9,10,17,18,19,20), ptB=c(5,6,7,8,21,20,19,18)) In this data frame you have only 2 patients with 4 visits each, but the correlation of ptA and ptB is

Re: [R] Storing user-defined R functions

2011-03-24 Thread Thomas Lumley
On Fri, Mar 25, 2011 at 5:11 AM, David.Epstein david.epst...@warwick.ac.uk wrote: Hello, I don't want to find out how to make packages unless that becomes necessary. Also, I don't want to clog up the computer memory with functions that I'm not using. (It would be great if someone in this forum

Re: [R] Longitudinal categorical response data

2011-03-24 Thread Ingmar Visser
package msm has some examples with this type of type, ie modeling disease state transitions in continuous time, using multi-state markov models. hth, Ingmar On Thu, Mar 24, 2011 at 6:22 PM, Rasanga Ruwanthi ruwanthi_...@yahoo.comwrote: Dear List, I have some longitudinal data, each patient

Re: [R] apply mean to a three-dimension data

2011-03-24 Thread David Winsemius
Are you taking the same online course as Barth Riley, who posed a very similar question only this morning? On Mar 24, 2011, at 11:07 AM, Hui Du wrote: Hi All, Suppose I have data like b[[1]] = matrix(1:4, 2, 2) b[[2]] = matrix(10:13, 2, 2) b[[3]] = matrix(20:23, 2, 2) [[1]]

Re: [R] Questions for domist... subscript out of bounds

2011-03-24 Thread Sarah Goslee
I want to use domain function to run species distribution model in R. I used sp.occ.do-domain(env.pre, pred_train, factors=c('continent')) sp.occ.pre.pro-predict(env.pre, sp.occ.do) to predict species distribution. BUT, I got Error in domdist(object, ln[j], vals[, ln[j]]) : subscript out of

Re: [R] Millisecond TimeStamps

2011-03-24 Thread David Reiner
?strptime or ?options d1 - as.POSIXct(2009-09-30 10:00:00.543) d1 [1] 2009-09-30 10:00:00 CDT # Oh, yeah, I forgot op - options(digits.secs=6) # or 3 d1 [1] 2009-09-30 10:00:00.543 CDT # The accuracy was there already HTH, David L. Reiner, PhD Head Quant XR Trading LLC -Original

Re: [R] apply mean to a three-dimension data

2011-03-24 Thread Jorge Ivan Velez
Sorry, the above should have been mymean - function(x) Reduce(+, x)/length(x) mymean(b) [,1] [,2] [1,] 10.3 12.3 [2,] 11.3 13.3 Apologies for the noise. Best, Jorge On Thu, Mar 24, 2011 at 3:54 PM, Jorge Ivan Velez wrote: Hi Hui, Ssee ?Reduce for more

Re: [R] apply mean to a three-dimension data

2011-03-24 Thread Jorge Ivan Velez
Hi Hui, Ssee ?Reduce for more details. You might try something along the lines of mymean - function(x) Reduce(+, x)/length(x) add(b) [,1] [,2] [1,] 10.3 12.3 [2,] 11.3 13.3 HTH, Jorge On Thu, Mar 24, 2011 at 11:07 AM, Hui Du wrote: Hi All,

Re: [R] How create vector that sums correct responses for multiple subjects?

2011-03-24 Thread Sarah Goslee
Try this: tapply(mydata$Correct, mydata$Subject, function(x)sum(x == C)) Sarah On Thu, Mar 24, 2011 at 3:24 PM, Kevin Burnham kburn...@gmail.com wrote: I have a data file with indicates pretest scores for a linguistics experiment.  The data are in long form so for each of 33 subjects there

Re: [R] How create vector that sums correct responses for multiple subjects?

2011-03-24 Thread Jorge Ivan Velez
Hi Kevin, Try this (untested): sapply(split(pretestdata, Subject), function(l) with(l$Correct == C)) HTH, Jorge On Thu, Mar 24, 2011 at 3:24 PM, Kevin Burnham wrote: I have a data file with indicates pretest scores for a linguistics experiment. The data are in long form so for each of 33

Re: [R] Millisecond TimeStamps

2011-03-24 Thread Dirk Eddelbuettel
On 24 March 2011 at 13:13, Madaliso Mulaisho wrote: | I am wondering if there is a good way to work with data that is indexed in | time, via timestamps with a resolution in milliseconds. As I understand it, | the POSIX classes have a resolution i n terms of seconds, and will not | process

Re: [R] Millisecond TimeStamps

2011-03-24 Thread David Winsemius
On Mar 24, 2011, at 1:13 PM, Madaliso Mulaisho wrote: I am wondering if there is a good way to work with data that is indexed in time, via timestamps with a resolution in milliseconds. As I understand it, the POSIX classes have a resolution i n terms of seconds, and will not process

Re: [R] Questions for domist... subscript out of bounds

2011-03-24 Thread David Winsemius
On Mar 24, 2011, at 1:15 PM, jessiecy2001 wrote: Hi all, I am a new user for R. I faced a questions about subscript out of bounds. Although I checked some other helps before I sent this email, I still don't know how to deal with this problems. I want to use domain function to run species

Re: [R] Storing user-defined R functions

2011-03-24 Thread David Scott
On 25/03/11 09:08, Thomas Lumley wrote: On Fri, Mar 25, 2011 at 5:11 AM, David.Epstein david.epst...@warwick.ac.uk wrote: Hello, I don't want to find out how to make packages unless that becomes necessary. Also, I don't want to clog up the computer memory with functions that I'm not using.

Re: [R] Problems with predict in fGarch

2011-03-24 Thread Prof. John C Nash
It's likely that the loss function has a log() or 1/x and the finite difference approximations to gradients have added / subtracted a small number and caused a singularity. Unfortunately, you'll need to dig into the fGarch code or write your own (ouch!). Or perhaps the fGarch package maintainer

Re: [R] Colour makes my life; but not my bwplot (panel.violin)

2011-03-24 Thread David Winsemius
On Mar 24, 2011, at 1:37 PM, JP wrote: Using Trellis, am successfully setting up a number of panels (25) in which I have two box and violin plots. I would like to colour - one plot as RED and the other as BLUE (in each panel). I can do that with the box plots, but the violin density

[R] Jri Examples

2011-03-24 Thread Richard Schäfer
Hello, Im new to R and I just successfully installed Jri. However I dont quite get the rtest examples. Is it working? One the console: Creating Rengine (with arguments) Rengine created, waiting for R re-routing stdout/err into R console rBusy(0) And the java window is asking me: to save the

Re: [R] How create vector that sums correct responses for multiple subjects?

2011-03-24 Thread Hadley Wickham
On Thu, Mar 24, 2011 at 2:24 PM, Kevin Burnham kburn...@gmail.com wrote: I have a data file with indicates pretest scores for a linguistics experiment.  The data are in long form so for each of 33 subjects there are 400 rows, one for each item on the test, and there is a column called

Re: [R] Help with creating a ts (time series) object with daily sampling values

2011-03-24 Thread Gabor Grothendieck
On Thu, Mar 24, 2011 at 3:25 PM, Pamela Allen allen_...@hotmail.com wrote: Hi All, I have a data set of daily measurements of river flow. I would like to create a “ts” object from this data. Here’s a sample data set: date - as.Date(c(1:300), format=%Y) year=as.numeric(format(date,

Re: [R] Storing user-defined R functions

2011-03-24 Thread Duncan Murdoch
On 11-03-24 4:08 PM, Thomas Lumley wrote: On Fri, Mar 25, 2011 at 5:11 AM, David.Epstein david.epst...@warwick.ac.uk wrote: Hello, I don't want to find out how to make packages unless that becomes necessary. Also, I don't want to clog up the computer memory with functions that I'm not using.

[R] tapply with specific quantile value

2011-03-24 Thread Steven Ranney
All - I have an example data frame x l.c.1 43.38812035 085 47.55710661 085 47.55710661 085 51.99211429 085 51.99211429 095 54.78449958 095 54.78449958 095 56.70201864 095 56.70201864 105 59.66361903 105 61.69573564 105 61.69573564 105

Re: [R] tapply with specific quantile value

2011-03-24 Thread Peter Alspach
Tena koe Steven The ... argument of the apply series of functions allows one to pass arguments to the called function. So: tapply(x, l.c.1, quantile, probs=0.75) should work (although I haven't tested it). HTH . Peter Alspach -Original Message- From:

Re: [R] tapply with specific quantile value

2011-03-24 Thread Tóth Dénes
Just have a look at ?quantile and the probs argument. tapply(x, l.c.1, quantile,probs=0.75) Anyway, quantiles and quartiles are not the same. I guess you meant the 3rd quartile. All - I have an example data frame x l.c.1 43.38812035 085 47.55710661 085 47.55710661 085

Re: [R] tapply with specific quantile value

2011-03-24 Thread Jorge Ivan Velez
Hi Steven, See the prob argument under ?quantile. The following should be what you want: tapply(x, l.c.1, quantile, prob = 0.75) HTH, Jorge * * On Thu, Mar 24, 2011 at 7:18 PM, Steven Ranney wrote: All - I have an example data frame x l.c.1 43.38812035 085 47.55710661

Re: [R] Using C code in R

2011-03-24 Thread Steve Lianoglou
Hi Jaimin, Please include r-help in your reply -- it's not included by default, so you'll have to use your email client's reply all functionality when responding to posts coming from the mailing list. This way (i) more people will be able to help you than just me; and (ii) if someone runs into

Re: [R] tapply with specific quantile value

2011-03-24 Thread Steven Ranney
Worked just fine. I had been incorrectly trying tapply(x, l.c.1, quantile(probs=0.75)) rather than tapply(x, l.c.1, quantile, probs=0.75) Thanks for the help - SR Steven H. Ranney On Thu, Mar 24, 2011 at 6:03 PM, Peter Alspach peter.alsp...@plantandfood.co.nz wrote: Tena koe Steven The

[R] error in bargraph.CI {sciplot}

2011-03-24 Thread barbara costa
Hi to all, Does anybody knows why this is giving an error? data(ToothGrowth) # Two-way design with options bargraph.CI(dose, len, group = supp, data = ToothGrowth, xlab = Dose, ylab = Growth, cex.lab = 1.5, x.leg = 1, col = black, angle = 45, cex.names = 1.25,

Re: [R] Using C code in R

2011-03-24 Thread Steve Lianoglou
Trying to send to the list, take 3 (for some reason my mails get bounced when I send to r-help@r-project.org, and not when I send to r-h...@stat.math.ethz.ch) On Thu, Mar 24, 2011 at 8:34 PM, Steve Lianoglou mailinglist.honey...@gmail.com wrote: Hi Jaimin, Please include r-help in your reply

[R] symmetric ( square) contingency table from dataset of unordered pairs

2011-03-24 Thread Daniel Weitzenfeld
Hi Everybody, I have a data set in which each observation has a pair of students, with each kid id'd by a 4 digit number: head(PAIRS) student1 student2 2 2213 2200 4 2198 2195 5 2199 2191 6 2229 2221 7 2247 2249 8 2250 2263 There is no

  1   2   >