Re: [R] predict.coxph

2010-11-12 Thread James C. Whanger
mean. > > The suggestion to use ordinary regression on the observed times is > wrong. Censored data is more complex than that. > > Terry Therneau > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo

Re: [R] predict.coxph and predict.survreg

2010-11-11 Thread James C. Whanger
t; R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- *James C. Whanger Research Consultant 2 Wolf

[R] Calling R from MS SQL Server

2010-11-10 Thread James Evans
We would like to call R functions from within MS SQL Server queries. Any advice on this would be appreciated. Thanks! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-proje

[R] leaps::regsubsets p-value

2010-11-10 Thread James Stegen
Hi, does anyone know if there is a way to easily extract p-values from the regsubsets() function? Thanks, James Stegen p.s. this is a reposting due to me not putting in a useful subject heading... -- James C. Stegen NSF Postdoctoral Fellow in Bioinformatics University of North Carolina Chapel

[R] sem: variance explained

2010-11-10 Thread James Stegen
Hi, does anyone know if there is a way to extract the variance of each variable explained in a structural equation model when using the sem() function? Thanks, James Stegen -- James C. Stegen NSF Postdoctoral Fellow in Bioinformatics University of North Carolina Chapel Hill, NC 919-962-8795

[R] p-value from regsubsets

2010-11-10 Thread James Stegen
Hi, does anyone know if there is a way to easily extract p-values from the regsubsets() function? Thanks, James Stegen -- James C. Stegen NSF Postdoctoral Fellow in Bioinformatics University of North Carolina Chapel Hill, NC 919-962-8795 ste...@email.unc.edu http://www.unc.edu/~stegen

[R] external R scripts

2010-11-10 Thread Maas James Dr (MED)
Is it possible to send data from an executing R script, to external R script files, on linux in this case, get that external R script to execute, and pass results back to the central script? If so what commands should I be looking at? I've googled for R and external, stuff like that but no luc

[R] jags error message

2010-11-09 Thread Maas James Dr (MED)
Could anyone give me some clues as to the best way to debug this error message? I think it is from the passing of variables back to R from the jags function which does Bayesian fitting. The curious part for me is that the error messages seem random, yet the input data are always the same. An

Re: [R] How to plot a normal distribution curve and a shaded tail with alpha?

2010-11-08 Thread James Long
Here's an example of a PDF with the tails shaded: http://stackoverflow.com/q/3494593/37751 -JD On Mon, Nov 8, 2010 at 10:18 AM, Wu Gong wrote: > > I want to create a graph to express the idea of the area under a pdf curve, > like > > http://r.789695.n4.nabble.com/file/n3032194/w7295e04.jpg > >

[R] ANOVA table and lmer

2010-11-04 Thread James Booth
The following output results from fitting models using lmer and lm to data arising from a split-plot experiment (#320 from "Small Data Sets" by Hand et al. 1994). The data is given at the bottom of this message. My question is why is the sum of squares for variety (V) different in the ANOVA t

[R] bugs and misfeatures in polr(MASS).... fixed!

2010-11-02 Thread Mr Timothy James BENHAM
In polr.R the (several) functions gmin and fmin contain the code > theta <- beta[pc + 1L:q] > gamm <- c(-100, cumsum(c(theta[1L], exp(theta[-1L]))), 100) That's bad. There's no reason to suppose beta[pc+1L] is larger than -100 or that the cumulative sum is smaller than 100. For pr

Re: [R] extracting named vector from dataframe

2010-10-31 Thread James Hirschorn
tions such as sort(). -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Sunday, October 31, 2010 12:24 PM To: James Hirschorn Cc: R-help@r-project.org Subject: Re: [R] extracting named vector from dataframe On Oct 31, 2010, at 11:54 AM, James Hirschorn

[R] extracting named vector from dataframe

2010-10-31 Thread James Hirschorn
Suppose df is a dataframe with one named row of numeric observations. I want to coerce df into a named vector. as.vector does not work as I expected: as.vector(df) returns the original dataframe, while as.vector(df,mode="numeric") returns an unnamed vector of NAs. This works: > v <- as

Re: [R] Long model formulae

2010-10-24 Thread James Hirschorn
> > Here is a dodge I often use. This is a mock-up example. Very instructive (and helpful) ... > > ___ > > bar <- data.frame(matrix(rnorm(1001), nrow = 1)) > names(bar)[1] <- "y" ## say > head(bar[,1:5]) > > nbar <- names(bar) > form <- as.formula(paste(nbar[1], "~", paste(nbar[-1],

[R] Long model formulae

2010-10-23 Thread James Hirschorn
What is a good way to enter a very long model formula. For example: y ~ Input.2 + Input.3 + ... + Input.1000 (assuming the corresponding dataframe has many other columns). Is there a way to convert a character string to a formula? Are there command line expansions in R besides the simple '.'?

[R] Problem with Aggregate - Sum, limit on number of criteria

2010-10-22 Thread James Splinter
els(ind) : NAs produced by integer overflow 3: In grp * nlevels(ind) : NAs produced by integer overflow 4: In grp * nlevels(ind) : NAs produced by integer overflow I tried searching for this error message but didn't find anything. I have very little programming background, but my colleague re

[R] getting all contrasts from glm

2010-10-22 Thread Maas James Dr (MED)
I'm using the following model to do an analysis faicout <- glm(cbind(events,patnums-events) ~ as.factor(treat) + as.factor(numtrial), family = binomial ) Is this example there are 4 treatments . In the glm object I can find the contrasts of the main treats vs the first i.e. 2v1, 3v1 and 4v1 .

[R] create a list fails

2010-10-20 Thread Maas James Dr (MED)
I can not understand why this fails > > faicoutput2 <- list(stuff21 = as.numeric(faicout$coefficients[2]), + stuff31=as.numeric(faicout$coefficients[3]), + stuff41=as.numeric(faicout$coefficients[4]), + stuff32=(stuff21-stuff31), +

[R] Recovering x/y coordinates from a scatterplot image

2010-10-15 Thread Rob James
Do I recall correctly that there is an R package that can take an image, and help one estimate the x/y coordinates? I can't find the package, thought it was an R-tool, but would appreciate any leads. Thanks, Rob __ R-help@r-project.org mailing list

[R] rbind ing matrices and resetting column numbers

2010-10-14 Thread Maas James Dr (MED)
Sorry for the verbose example. I want to row bind two matrices, and all works except I want the column labelled "row" to be sequential in the new matrix, shown as "mat3" here, i.e. needs to be 1:6 and not 1:3 repeated twice. Any suggestions? Thanks J > colnm1 <- c("row","ti","counti") > col

[R] exponentiate elements of a whole matrix

2010-10-13 Thread Maas James Dr (MED)
I've tried hard to find a way to exponentiate each element of a whole matrix such that if I start with A A = [ 2 3 2 4] I can get back B B = [ 7.38 20.08 7.38 54.60] I've tried B <- exp(A) but no luck. Thanks J === Dr. Jim Maas University of

[R] debugging

2010-10-07 Thread Maas James Dr (MED)
I'm attempting to learn how to use the debug function to find the values of some variables. I've found a couple of documents describing the basics and they show examples that the debugger returns "Browse[1]>" but for some reason when I follow the examples I get "Browse[2]>" What is the "2"

Re: [R] read columns of quoted numbers as factors

2010-10-05 Thread james hirschorn
d columns differently, analogously to write.table. However, there does not even seem to be an option to make read.table behave analogously. - Original Message ---- From: peter dalgaard To: james hirschorn Cc: r-help@r-project.org Sent: Tue, October 5, 2010 7:25:52 AM Subject: Re: [R

Re: [R] Fisher exact test?

2010-10-04 Thread James Nead
Hi Thomas, Thanks for the reply. 1. In the first pick, I draw 'A' genes from N, without replacement. 2. Similarly, in the second pick, I draw 'B' genes from N, without replacement (and 'C' genes from 'N' etc.) 3. Order does not matter - so the two cases you cited are equivalent. I would like to

[R] read columns of quoted numbers as factors

2010-10-04 Thread james hirschorn
Suppose I have a data file (possibly with a huge number of columns), where the columns with factors are coded as "1", "2", "3", etc ... The default behavior of read.table is to convert these columns to integer vectors. Is there a way to get read.table to recognize that columns of quoted number

[R] Fisher exact test?

2010-10-04 Thread James Nead
Hi All, My apologies if this is a totally newbie question. I want to calculate the probability that a particular set of genes is picked repeatedly for 3 samplings. For example, if from a total of 'N' genes, I pick 'A' number of genes in the first pick, 'B' number of genes in the second pick,

[R] Error: attempt to apply non-function

2010-09-23 Thread Maas James Dr (MED)
This code worked fine for me, then did some cleaning up of formatting using ESS (Emacs) and now I get this error, no idea what is causing it, all the brackets/parentheses seem to be balanced. What have I done wrong? Thanks Jim p0.trial01 <- 0.25 TruOR01 <- 0.80 num.patients.01 <- 50 num.tri

Re: [R] removing specific rows from array

2010-09-18 Thread Maas James Dr (MED)
Dr. Jim Maas University of East Anglia From: Michael Bedward [michael.bedw...@gmail.com] Sent: 18 September 2010 04:14 To: Maas James Dr (MED) Cc: r-help@r-project.org Subject: Re: [R] removing specific rows from array Here's one way... treats <- c(&

[R] removing specific rows from array

2010-09-17 Thread Maas James Dr (MED)
I'm attempting to create an array of treatment comparisons for modelling data generation. This involves comparison of one treatment (c2) with another (c3), relative to a common comparator (c1). Attached code gives me the correct array but need to remove duplicates. Duplicates relate only to c

[R] using variable from for loop in naming new variables

2010-09-16 Thread Maas James Dr (MED)
Simple one here ... but can't get it to work ... for (i in 1:4){ paste("stuff",[i]),sep="") <- 3 + i } ls() rm(list=ls()) I just want it to create 4 new variables called stuff1, stuff2, stuff3, stuff4 with the corresponding assignments. I realise that there are more elegant functions bu

[R] Instal R on OS X Server

2010-09-16 Thread James Nead
Hi, I was trying to install R in my home directory on a Mac OS X Server running Darwin. How do I go about installing it? How can I install from the binary provided (R-2.11.1.pkg) from command line? Is there any other information that I can provide? thanks [[alternative HTML ve

[R] biclust - jaccardind

2010-09-14 Thread James Nead
Hi, I looked at the help documentation, but couldn't find the algorithm for calculating the modified jaccard index for separate sets of biclusters. Is there a link to some documentation on this? many thanks! [[alternative HTML version deleted]] __

[R] Transparent Labels for Polar Plot

2010-09-13 Thread James MacCarthy
Hello, I am currently using the polar.plot function in the plotrix package to graph data. Unfortunately, it seems that the default for the labels is to have a background color that is covering the line representing my data, making it difficult to read. Is there a way to make this label backgrou

Re: [R] Sample a vector repeatedly

2010-09-13 Thread James Hudson
Thank you Marc - the first scenario. On Mon, Sep 13, 2010 at 2:04 PM, Marc Schwartz wrote: > > On Sep 13, 2010, at 10:30 AM, James Hudson wrote: > > > I‚d like to sample the vector „y‰ repeatedly. In this dummy dataset, > > I‚d > > like to sample (and

[R] Sample a vector repeatedly

2010-09-13 Thread James Hudson
I’d like to sample the vector “y” repeatedly. In this dummy dataset, I’d like to sample (and store) it 1, 2, and 3 times. Is there a straightforward way to do this without using a “for” loop? x <- c(1 :3) y <- c(1:10) (run.sample <- sample (y, x)) Thanks very much, Jam

Re: [R] How to project a vector on a subspace?

2010-09-09 Thread James
Hi Peng, Gabor & Peter, Thank you very much for replying me so soon. I will try it right now! -- View this message in context: http://r.789695.n4.nabble.com/How-to-project-a-vector-on-a-subspace-tp2530886p2532388.html Sent from the R help mailing list archive at Nabble.com. _

[R] XML getNodeSet syntax for PUBMED XML export

2010-09-08 Thread Rob James
I am looking for the syntax to capture XML tags marked with /DescriptorName MajorTopicYN="Y"/ , but the combination of the internal space (between "Name" and "Major" and the embedded quote marks are defeating me. I can get all the "DescriptorName" tags, but these include both MajroTopicYN

[R] How to project a vector on a subspace?

2010-09-08 Thread James
Hi experts, I have a subspace represented as matrix of basic vectors and I want to project a vector on that subspace. Does R have any function that help me to do so? Thanks, James. -- View this message in context: http://r.789695.n4.nabble.com/How-to-project-a-vector-on-a-subspace

[R] How to use prediction

2010-09-04 Thread James
() but I don't know how to bring the result of kcca() to use as parameters for gausspr(). Any replies is appreciated! Thanks a lot, James. -- View this message in context: http://r.789695.n4.nabble.com/How-to-use-prediction-tp2527030p2527030.html Sent from the R help mailing list archi

Re: [R] Linear models (lme4) - basic question

2010-09-02 Thread James Nead
__ From: Ben Bolker To: r-h...@stat.math.ethz.ch Sent: Thu, September 2, 2010 2:06:47 PM Subject: Re: [R] Linear models (lme4) - basic question James Nead yahoo.com> writes: > > Sorry, forgot to mention that the processed data will be used as input for a > classification alg

Re: [R] Linear models (lme4) - basic question

2010-09-02 Thread James Nead
Sorry, forgot to mention that the processed data will be used as input for a classification algorithm. So, I need to adjust for known effects before I can use the data. thanks From: Bert Gunter Cc: r-help@r-project.org Sent: Thu, September 2, 2010 12:46:13

Re: [R] Linear models (lme4) - basic question

2010-09-02 Thread James Nead
Hi Bert, Thanks for the reply. Height, was just as an example. Perhaps, I should have said 'x' instead of height. Essentially, what I want to do is adjust the data for known effects. After I've done this, I can conduct further analysis on the data (for example, if another variable 'z' has an

[R] Linear models (lme4) - basic question

2010-09-02 Thread James Nead
Hi, Sorry for a basic questions on linear models. I am trying to adjust raw data for both fixed and mixed effects. The data that I output should account for these effects, so that I can use the adjusted data for further analysis. For example, if I have the blood sugar levels for 30 patients,

[R] biclust package

2010-09-01 Thread James Nead
Hi, I wanted to compare the quality of biclusters obtained from the various biclustering algorithms. Is there a function/metric in biclust (or some other package) that will enable me to do this? thanks! [[alternative HTML version deleted]]

[R] pasting together 2 character arrays

2010-08-31 Thread Maas James Dr (MED)
If possible I would like to combine two different character arrays in combinations Array1 <- c("height","weight","age","sex") Array2 <- c("trt0","trt1","trt2") I would like to combine these two character vectors to end up with such ... Array3 "height.trt0.trt1" "height.trt0.trt2" "weight.trt0

[R] multiple assignments ?

2010-08-24 Thread Maas James Dr (MED)
Simple one, have read and googled, still no luck! I want to create several empty vectors all of the same length. I would like multiple empty vectors (vec1, vec2, vec3) and want to create them all in one line. I've tried vec1,vec2,vec3 <- vector(length=5) and c(vec1,vec2,vec3) <- vector(length=

[R] output values from within a function

2010-08-20 Thread Maas James Dr (MED)
Is it possible to get R to output the value of an expression, that is being calculated within a function? I've attached a very simple example but for more complicated ones would like to be able to debug by seeing what the value of specific expressions are each time it cycles through a loop that

Re: [R] probabilities from predict.svm

2010-08-19 Thread Watling,James I
e this out! Much appreciated James -Original Message- From: Steve Lianoglou [mailto:mailinglist.honey...@gmail.com] Sent: Thursday, August 19, 2010 11:39 AM To: Watling,James I Cc: r-h...@lists.r-project.org Subject: Re: [R] probabilities from predict.svm On Thu, Aug 19, 2010 a

Re: [R] probabilities from predict.svm

2010-08-19 Thread Watling,James I
svm.model, predict.data, probability=T)should be so off-base, but it seems like they are. Any thoughts? James -Original Message- From: Steve Lianoglou [mailto:mailinglist.honey...@gmail.com] Sent: Thursday, August 19, 2010 10:24 AM To: Watling,James I Cc: r-h...@lists.r-proj

[R] combinations

2010-08-18 Thread Maas James Dr (MED)
I would appreciate any suggestions on which function to use to write subsequent functions analysing combinations of treatments. This refers to experimental trials of medical treatments. I want to write routines to analyse various comparisons (combinations) So if 5 treatments are available

[R] HMisc/rms package questions

2010-08-17 Thread Rob James
1) How does one capture the plots from the plsmo procedure? Simply inserting a routing call to a graphical device (such as jpeg, png, etc) and then running the plsmo procedure (and then dev.off()) does not route the output to the file system. 1b) Related to above, has anyone thought of revising

Re: [R] Adding colored background area to a time series plot

2010-08-15 Thread James Toll
On Aug 15, 2010, at 10:40 AM, Gabor Grothendieck wrote: > On Sun, Aug 15, 2010 at 12:21 PM, James Toll wrote: >> Hi, >> >> I am trying to add a rectangular colored background area to a plot of a time >> series of relative price changes. I believe that what I'm

[R] Adding colored background area to a time series plot

2010-08-15 Thread James Toll
xamples linked above? I'd like to be able to use this with chartSeries, rather than plot, but I thought it would be easiest to figure it out using plot first. Clearly that hasn't helped me. Thanks for any advice you can provide. James __ R

[R] Specifying interactions in rms package... error

2010-08-02 Thread Rob James
I am encountering an error I do not know how to debug. The error arises when I try to add an interaction term involving two continuous variables (defined using rcs functions) to an existing (and working) model. The new model reads: model5 <- lrm( B_fainting ~ gender+ rcs(exactage, 7) +

[R] ScrapeR Unanticipated XML objects

2010-08-01 Thread Sparks, John James
Dear All, I have come across a very surprising result as I have started to learn how to use R to pull data from the web for analysis. I am trying to isolate that table headers for the quarterly income statement (qtrinc) that I pulled from Google finance. I executed the following commands after i

[R] Picking Part of Large R Object

2010-08-01 Thread Sparks, John James
Dear All, I have imported an HTML document to R (called tables) and wish to select certain pieces of it for processing. The first few lines of the object appear as follows: > tables [[1]] In Millions of USD (except for per share items) 3 months ending 2010-06-30 3 months ending 2010

Re: [R] Identify points (was Plot error)

2010-07-18 Thread James Platt
tk/libs/i386/tcltk.so Reason: image not found Error: package/namespace load failed for 'tcltk' Cheers, James On 17 Jul 2010, at 18:12, Peter Ehlers wrote: On 2010-07-17 9:50, James Platt wrote: The other question I have: Is there any way to link the data point on the graph to t

Re: [R] Plot error

2010-07-17 Thread James Platt
The other question I have: Is there any way to link the data point on the graph to the name of a row i.e in my table: name value_1 value_2 bill 14 ben 2 2 jane 3 1 I click on the data point at 2,2 and it would read out ben thanks again. James

Re: [R] Plot error

2010-07-17 Thread James Platt
ue_1"] y <- test[ , "value_2"] #plot plot(x, y) cheers, James On 17 Jul 2010, at 16:07, Joshua Wiley wrote: Hi James, I believe the issue has to do with the values you assigned to 'x' and 'y'. You call the function c() on seq["value_1"], but you

[R] Plot error

2010-07-17 Thread James Platt
, header=TRUE) >x <-c(seq["value_1"]) >y <-c(seq["value_2"]) >plot(x,y) and i get this error Error in xy.coords(x, y, xlabel, ylabel, log) : (list) object cannot be coerced to type 'double' What does this mean and how do i fix it? Thanks for t

Re: [R] Can I set default parameters for the default graphics device?

2010-07-15 Thread James
#x27;m definitely going to try this, thanks in advanced!  I'm excited, maybe I'll finally get passed this hurdle. :) -James __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gu

Re: [R] Can I set default parameters for the default graphics device?

2010-07-15 Thread James
On Thu, Jul 15, 2010 at 8:43 PM, Erik Iverson wrote: > On 07/15/2010 07:10 PM, James wrote: >> I'm completely new to R, and I'd like to do something like this: >> > x=c(1,2,3) >> > plot(x,x) >> At this point, R creates a file "Rplots.

Re: [R] Can I set default parameters for the default graphics device?

2010-07-15 Thread James
love to be able to set the default name for output images. -James [[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 http://www.R-project.org/postin

[R] Can I set default parameters for the default graphics device?

2010-07-15 Thread James
I'm completely new to R, and I'd like to do something like this: > x=c(1,2,3) > plot(x,x) At this point, R creates a file "Rplots.pdf", since the default device is PDF and the default filename is "Rplots.pdf". I know I can set the default device like this: > options(device="png") B

[R] adding a row of names to data.frame

2010-07-05 Thread Maas James Dr (MED)
Relative noob here, I have a data.frame and simply want to add an explicit column of names in column 1 of the form "trial_number01" for row 1, "trial_number02" for row 2 etc. It is simply for visual purposes and to explain data to others. I've tried Using row.names and other but still no l

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-28 Thread James W. MacDonald
e. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting- guide.html and provide commented, minimal, self-contained, reproducible code. _____

Re: [R] RJDBC vs RMySQL vs ???

2010-06-24 Thread James W. MacDonald
d to allow one to query any DBMS. Since RMySQL is MySQL-specific, it may be more efficient. Anyway, why don't you just try it and see? Best, Jim Best, Ralf On Wed, Jun 23, 2010 at 4:36 PM, James W. MacDonald wrote: Hi Ralf, Ralf B wrote: I am running a simple SQL SELECT statemen

Re: [R] RJDBC vs RMySQL vs ???

2010-06-23 Thread James W. MacDonald
R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- James W. MacDonald, M.S. Biostatistician Douglas Lab University of Mich

[R] vectorize subscript ranges?

2010-06-14 Thread James McCreight
s #like from time 10 to time 24 and time 51 to time 86 starts <- c(10,51) ends <- c(24,86) results <-c(NA,NA) #then you'd typically loop for (i in 1:2) { results[i] <- mean(d[starts[i]:ends[i]) } can it be done without looping? Thanks in advance. James

Re: [R] Subtracting POSIXct data/times

2010-06-14 Thread James Rome
(when you don't specify, it chooses the units according to some rules) > > -Don > > At 4:24 PM -0400 6/14/10, James Rome wrote: >> I have two dataframe columns of POXIXct data/times that include seconds. >> I got them into this format using for example >> zsort$ETA &

[R] Subtracting POSIXct data/times

2010-06-14 Thread James Rome
I have two dataframe columns of POXIXct data/times that include seconds. I got them into this format using for example zsort$ETA <- as.POSIXct(as.character(zsort$ETA), format="%m/%d/%Y %H:%M:%S") My problem is that when I subtract the two columns, sometimes the difference is given in seconds, and

Re: [R] xtable with Sweave

2010-06-14 Thread James W. MacDonald
ne: 3371-4346 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- James W

Re: [R] import text file into R

2010-06-03 Thread Bird James-R31391
You may want to try read.delim if you are having troubles with read.table. Jim -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of dhanush Sent: Thursday, June 03, 2010 4:33 AM To: r-help@r-project.org Subject: [R] import text file int

[R] selecting monotone pattern of missing data from a dataframe with mixed pattern of missingness

2010-05-31 Thread john james
Dear R- User,   I have a dataset that looks like the following:   jh<-data.frame(  'id'=seq(1,10,1),   'time0'=c(8,5,8,8,9,NA,NA,2,4,5),   'time4'=c(NA,NA,9,8,NA,2,3,2,4,5),  'time8'=c(NA,2,8,NA,5,NA,2,3,NA,4),  'time12'=c(NA,2,NA,NA,NA,3,3,2,3,NA),   'sex'=c('m','f','m','m','f','f','f','m','f','m'

[R] Creating dropout time from longitudinal data with missing data

2010-05-30 Thread john james
in dataframe 'dat' such that the dropout time is the time to drop out by the subject as follows:     dat<-data.frame(   'id'=rep(c(1,2,3),each=3),   'time'=rep(c(1,2,3),3),   'y'= c(2,2,NA,2,NA,NA,2,5,7),   'dropout time'=

[R] Assigning NA to a rows of a dataframe/datamatrix

2010-05-25 Thread john james
Dear R-users,  I have a problem, I have the following dataframe:   d<-data.frame(  'y1'=c(1,2,1,2,1,NA,NA), 'y2'=c(1,2,1,1,1,2,1), 'y3'=c(1,NA,1,NA,NA,2,1), 'y4'=c(NA,2,NA,1,1,2,NA), 'a'=c(1,1,1,1,1,1,2) ) where the last variable counts the number of missing values in a row. Now, i want to set ro

[R] Selecting Monotone pattern of missingness from a dataframe

2010-05-25 Thread john james
Dear R- users,   Pls help me with the following problem. I have a dataset that loooks like the following:   jh<-data.frame(  'id'=seq(1,10,1),  'time0'=c(8,5,8,8,9,NA,NA,2,4,5),  'time4'=c(NA,NA,9,8,NA,2,3,2,4,5), 'time8'=c(NA,2,8,NA,5,NA,2,3,NA,4),  'sex'=c('m','f','m','m','f','f','f','m','f','m'

[R] Help with dummy.coef

2010-05-04 Thread James M. Curran
2)),data = battery.df) dummy.coef(battery.fit) Error in rep.int(xl[[i]][1L], nl) : invalid 'times' value Thanks, James -- James M. Curran, Ph.D. Associate Professor Director Bioinformatics Institute Department of Statistics Faculty of Science Private Bag 92019 Auckland New Zealand ___

[R] Fidelity of lattice graphics captured to jpeg or png... followup

2010-04-29 Thread Rob James
Subsequent investigations (via GIMP) show that the problem is in OO, and now with the images themselves. Off to the OO forums. Original Message Subject:Fidelity of lattice graphics captured to jpeg or png Date: Thu, 29 Apr 2010 08:05:04 -0700 From: Rob James To

[R] Fidelity of lattice graphics captured to jpeg or png

2010-04-29 Thread Rob James
I am generating images via lattice from Frank Harrell's RMS package. These images are characterized by coloured lines and grey-scale confidence intervals. I need to port them to Openoffice/etc, and have tried both png and jpeg (at high quality), but in neither format can I subsequently see the

[R] logical(0) response from lrm

2010-04-25 Thread Rob James
What causes the error report: logical(0) to arise in the rms function lrm? Here's my data: But both the dependent and the independent variable seem fine... > str(AABB) 'data.frame':1176425 obs. of 9 variables: $ sex : int 1 1 0 1 1 0 0 0 0 0 ... $ faint : int 0 0 0 0 0 0 0 0 0 0

Re: [R] Subject: R and S-Plus: Two programs separated by a common language?

2010-04-22 Thread John James
sed: an active and mostly friendly R community. In addition there is a plethora of R community groups, London, Chicago, New York come to mind - drop along to some of them. And start to use R. Regards John James Mango - Original Message - From: r-help-boun...@r-project.org To: r-

Re: [R] bwplot puts the bars in the wrong place

2010-04-17 Thread James Rome
The data are at http://dl.dropbox.com/u/537118/gdf.zip On 4/17/2010 1:42 AM, Deepayan Sarkar wrote: On Fri, Apr 16, 2010 at 1:54 PM, James Rome wrote: > Dear R-Help, > > With the attached data set, I am still getting incorrect bwplots > None of your attachments came through

Re: [R] bwplot puts the bars in the wrong place

2010-04-16 Thread James Rome
On 4/16/2010 8:27 PM, Jun Shen wrote:Jim, Try this, bwplot(tt~as.factor(OnHour),data=gdf,..) Jun Shen from Millipore I already tried using a factor, and the data set I enclosed had gdf$OnHFact which was already a factor. It gave the same wrong plot. What did work was to call xyplot instead

[R] bwplot puts the bars in the wrong place

2010-04-16 Thread James Rome
Dear R-Help, With the attached data set, I am still getting incorrect bwplots > xyplot(gdf$tt~gdf$OnHour |gdf$Runway, data=gdf) # Is correct > bwplot(gdf$tt~gdf$OnHour |gdf$Runway, data=gdf, horizontal=FALSE) # Puts the boxes on the wrong x-axis values # look especially at 0 and 3. How do

[R] more on bwplot problem

2010-04-16 Thread James Rome
Alas, no one answered my last post about my problem of doing bwplot. I think my problem is related to the fact that there is a value missing in my data: levels(as.factor(gdf$OnHour)) [1] "0" "1" "2" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21

Re: [R] hugene10stv1cdf

2010-04-16 Thread James MacDonald
Best, Jim Thanks Christoph __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible c

Re: [R] Error in library(gplots) : there is no package called 'gplots'

2010-04-16 Thread james
Hi Vava, What version of R are you using? I'm not sure but I think that R will refuse to install a package in this way if the version of gplots is incompatiable with the version of R you're using. You can check the depends of packages on CRAN. Regards, James Vava wrote: Thank

[R] factors as bwplot x axis

2010-04-15 Thread James Rome
Dear List, I am having problems getting my box and whisker plots to put boxes on the right x-axis values. x is the hour of the day from 0 to 23. > unique(mdf$OnHour) [1] 5 4 6 7 11 12 9 8 19 14 13 21 20 10 18 17 15 16 23 22 0 1 3 2 mdf$OnHFact = factor(mdf$OnHour, levels=seq(0,23), labe

[R] [RPostgreSQL] Fails to load

2010-04-13 Thread james
Hi List, Running R 2.10.1 on a fresh install of Windows 7. I get the following error when loading the RPostgreSQL package. >library(RPostgreSQL) Loading required package: DBI Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared library 'C:/Users/james/D

[R] Scales and bwplots

2010-04-13 Thread James Rome
I would like to make a series of bwplots with scales that are the same on each plot. x is hours of the day, so I chose hrs = seq(0, 24, 4) hrlabs = c("0","4","8","12","16","20","") g = bwplot((gdf$tt)~gdf$OnHour | gdf$Runway, data=gdf, ylab="Taxi time (min

[R] efficiently picking one row from a data frame per unique key

2010-04-12 Thread James Kebinger
o do this d = data.frame(x=c(1,1,2,4),y=c(10,11,12,13),z=c(20,19,18,17)) d.ordered = d[order(-d$y),] aggregate(d.ordered,by=list(key=d.ordered$x),FUN=function(x){x[1]}) I've tried to use split and unsplit, but unsplit complained about duplicate row names when reassembling the sub frames.

[R] How to use tapply for quantile

2010-04-08 Thread James Rome
I am trying to calculate quantiles of a data frame column split up by two factors: # Calculate the quantiles quarts = tapply(gdf$tt, list(gdf$Runway, gdf$OnHour), FUN=quantile, na.rm = TRUE) This does not work: > quarts 04L 04R 15R 22L 22R 2732 33L

Re: [R] How to get the scale limits in lattice plot

2010-04-01 Thread James Rome
The key was to use grid.text() inside the panel function. It allows you to specify things in 0-1 "npc" units. On 4/1/10 12:23 PM, David Winsemius wrote: > > On Apr 1, 2010, at 11:53 AM, James Rome wrote: > >> I am drawing a density histogram, and want to label the plo

[R] How to get the scale limits in lattice plot

2010-04-01 Thread James Rome
I am drawing a density histogram, and want to label the plots with the mean using ltext(). But I need the x,y coordinates to feed into ltext, and I can't calculate them easily from my data. Is there a way to get the x and y ranges being used for the plot, so I can put the text at the correct positi

Re: [R] pdf files in loops

2010-03-31 Thread James Rome
On 3/31/2010 10:01 PM, Berwin A Turlach wrote: G'day James, On Wed, 31 Mar 2010 21:44:31 -0400 James Rome wrote: > I need to make a bunch of PDF files of histograms. > [...] > What am I doing wrong? > http://cran.ms.unimelb.edu.au/doc/FAQ/R-FAQ.html#Why-do-lattice_002

Re: [R] pdf files in loops

2010-03-31 Thread James Rome
On 3/31/2010 10:01 PM, Berwin A Turlach wrote: G'day James, On Wed, 31 Mar 2010 21:44:31 -0400 James Rome wrote: > I need to make a bunch of PDF files of histograms. > [...] > What am I doing wrong? > http://cran.ms.unimelb.edu.au/doc/FAQ/R-FAQ.html#Why-do-lattice_002

[R] pdf files in loops

2010-03-31 Thread James Rome
I need to make a bunch of PDF files of histograms. I tried gatelist = unique(mdf$ArrivalGate) for( gate in gatelist) { outfile = paste("../", airport, "/", airport, "taxiHistogram", gate, ".pdf", sep="") pdf(file = outfile, width = 10, height=8, par(lwd=1)) title=paste("Taxi tim

[R] Comparing times in two time zones

2010-03-31 Thread James Rome
I have data that is collected in two different time zones z$OnDateTime <- as.POSIXct(runway$OnDateTime, tz = "EST5EDT", format="%m/%d/%Y %H:%M") is in Eastern time, and zi$ActualOnLocal <- as.POSIXct(oooi$ActualOnLocal, tz="MST7MDT", format="%m/%d/%Y %H:%M") is in Mountain". I converted the runway

Re: [R] ggplot2: How to remove legend component for geom_errorbar() ?

2010-03-26 Thread James Rome
In general, one should be able to turn off the legend entirely. I did a plot with geom_jitter() and then overlaid it with geom_boxplot() and I got a legend with a sort of box drawn in a legend that was meaningless since there was no factor involved. Jim -- View this message in context: http://n

<    1   2   3   4   5   6   7   >