Re: [R] help with barplot

2011-05-27 Thread steven mosher
Thanks, ggplot is on my list of things to learn before Hadley comes here to the bay area to give a session on interactive graphics in R On Fri, May 27, 2011 at 10:29 PM, Joshua Wiley wrote: > Hi Steven, > > This is not, strictly speaking, the answer to your question (hopefully > Tom already a

Re: [R] Arrange a multi-level list to a one-level list

2011-05-27 Thread Lisa
Hi, Phil, Yes. That's what I am looking for. Thank you so much. Lisa -- View this message in context: http://r.789695.n4.nabble.com/Arrange-a-multi-level-list-to-a-one-level-list-tp3556500p3556601.html Sent from the R help mailing list archive at Nabble.com. __

[R] Sobol Sequences - Convergence Issues

2011-05-27 Thread Animesh Saxena
Hi, My question is regarding the R package "randtoolbox". I was testing it for few days for generating sobol sequences. As per my findings the numbers for higher dimensions > 30 are prone to clustering. This might be due to bad choice of initialization numbers or in some lingo called free dire

Re: [R] network package in R

2011-05-27 Thread Shi, Tao
Weiwei, I know this is not a Bioconductor-specific question, but you may also want to post it on BiC help list, as there may be more people there understand what you want to do. I'm also curious about the answers to your question. ...Tao - Original Message > From: Weiwei Shi > T

Re: [R] help with barplot

2011-05-27 Thread Joshua Wiley
Hi Steven, This is not, strictly speaking, the answer to your question (hopefully Tom already answered that). Rather, it is the answer to questions you *might* have asked (and perhaps one of them will be one you wished you had asked). Barplots have a low data:ink ratio...you are using an entire

Re: [R] help with barplot

2011-05-27 Thread Thomas Levine
Does this do it? barplot(t(matrix(pivot$x,4)),beside=T) Tom On Fri, May 27, 2011 at 6:08 PM, steven mosher wrote: > > Hi, > > I'm really struggling with barplot > > I have a data.frame with 3 columns. The first column represents an > "incident" type > The second column represents a "month" > Th

Re: [R] Fwd: Opening R in 64-bit version by default

2011-05-27 Thread David Winsemius
On May 27, 2011, at 8:56 PM, Duncan Murdoch wrote: but really, it's just a bug. If you manually change that registry key, things are fine. If you ask Windows dialogs to do it for you, it fails. Most people pay infinitely more to Microsoft for Windows than they pay to R Core for R.

Re: [R] Compiling Rgraphiz on Windows 7 64bit with R-2.13.0

2011-05-27 Thread Duncan Murdoch
On 11-05-27 5:51 PM, krusty the klown wrote: lol, I'm having problems with texi2dvi as well... The Rdlatex file says: Hmm ... looks like a package Error in texi2dvi("Rd2.tex", pdf = (out_ext == "pdf"), quiet = FALSE, : pdflatex is not available Error in running tools::texi2dvi You may want

Re: [R] Fwd: Opening R in 64-bit version by default

2011-05-27 Thread Duncan Murdoch
On 11-05-27 8:20 PM, John C Frain wrote: I have checked my second proposal using Windows 7 and Duncan is correct in saying that it will not work .r and .Rdata files were not associated to any version of R in my set up. On my system .r files are associated to the editor that I am using at any pa

Re: [R] network package in R

2011-05-27 Thread David Winsemius
On May 27, 2011, at 7:08 PM, Weiwei Shi wrote: > Please read my post carefully. > > I did search and found some functions I need for my purpose from > network package, like layout and its different algorithm. I used > pajek a couple of days and I found the "IO" part between R and pajek > a

Re: [R] Fwd: Opening R in 64-bit version by default

2011-05-27 Thread John C Frain
I have checked my second proposal using Windows 7 and Duncan is correct in saying that it will not work .r and .Rdata files were not associated to any version of R in my set up. On my system .r files are associated to the editor that I am using at any particular time. Currently this is either rS

Re: [R] Normality test

2011-05-27 Thread Robert Baer
I am writing to inquire about normality test given in nortest package. I have a random data set consisting of 300 samples. I am curious about which normality test in R would give me precise measurement, whether data sample is following normal distribution. As p value in each test is different in e

Re: [R] network package in R

2011-05-27 Thread Weiwei Shi
Please read my post carefully. I did search and found some functions I need for my purpose from network package, like layout and its different algorithm. I used pajek a couple of days and I found the "IO" part between R and pajek a little inconvenient; that's why I sent the question to find if net

Re: [R] Arrange a multi-level list to a one-level list

2011-05-27 Thread Phil Spector
Lisa - Are you looking for this? x <- list(list(matrix(sample(c(0,1), 4, replace = T), 2), + matrix(sample(c(2,3), 4, replace = T), 2)), + list(matrix(sample(c(0,1), 6, replace = T), 2), matrix(sample(c(2,3), 6, + replace = T), 2))) unlist(x,recursive=FALSE) [[1]] [,1] [,2] [1,]0

Re: [R] Survival: pyears and ratetable: expected events

2011-05-27 Thread David Winsemius
On May 27, 2011, at 5:35 PM, Jim Trabas wrote: I tried again but I cannot get a valid expected number of death directly from the pyear function. Using cross multiplication from Lifetables I am expecting in my cohort about 26 expected deaths (to match the 25 observed deaths). I have tried di

[R] Arrange a multi-level list to a one-level list

2011-05-27 Thread Lisa
Dear all, I just want to arrange a multi-level list to a one-level list. For example: x <- list(list(matrix(sample(c(0,1), 4, replace = T), 2), matrix(sample(c(2,3), 4, replace = T), 2)), list(matrix(sample(c(0,1), 6, replace = T), 2), matrix(sample(c(2,3), 6, replace = T), 2))) > x [[1]] [[1]][

Re: [R] eigenvalues and correlation matrices

2011-05-27 Thread dM/
Thanks Sarah. Silly mistake. I wrote the syntax when testing the correlation matrix, hence the symmetric = TRUE statement. I then thought, hang on a minute; I better check that and forgot to unwind the condition. At least I'm not going mad! On May 27, 8:40 pm, Sarah Goslee wrote: > Hi, > > Ho

Re: [R] Compiling Rgraphiz on Windows 7 64bit with R-2.13.0

2011-05-27 Thread krusty the klown
lol, I'm having problems with texi2dvi as well... The Rdlatex file says: Hmm ... looks like a package Error in texi2dvi("Rd2.tex", pdf = (out_ext == "pdf"), quiet = FALSE, : pdflatex is not available Error in running tools::texi2dvi You may want to clean up by 'rm -rf C:/DOCUME~1/AB/IMPOST~1/

Re: [R] Use apply on a function with multiple argument including a matrix ?

2011-05-27 Thread sunelav
Dear David, Thank you very much for your answer. I am going to try what you propose and compare the two methods. I have already done what I could to reduce the computation time of the function by using apply functions and by doing most of the calculation on matrices at once to avoid the use of

[R] Normality test

2011-05-27 Thread Salil Sharma
Dear Sir, I am writing to inquire about normality test given in nortest package. I have a random data set consisting of 300 samples. I am curious about which normality test in R would give me precise measurement, whether data sample is following normal distribution. As p value in each test is d

Re: [R] Survival: pyears and ratetable: expected events

2011-05-27 Thread Jim Trabas
I tried again but I cannot get a valid expected number of death directly from the pyear function. Using cross multiplication from Lifetables I am expecting in my cohort about 26 expected deaths (to match the 25 observed deaths). I have tried different variation of the pyears syntax but i get either

[R] help with barplot

2011-05-27 Thread steven mosher
Hi, I'm really struggling with barplot I have a data.frame with 3 columns. The first column represents an "incident" type The second column represents a "month" The third column represents a "time" Code for a sample data.frame incidents <- rep(c('a','b','d','e'), each =25) months<- rep(c(1

Re: [R] network package in R

2011-05-27 Thread David Winsemius
On May 27, 2011, at 5:32 PM, Weiwei Shi wrote: Hi there, I need a network builder and it can change the node size and color; I am not sure if network package in R can do this or not. The other functions I wanted have been found in that package. When I type ??network at my console I get p

[R] network package in R

2011-05-27 Thread Weiwei Shi
Hi there, I need a network builder and it can change the node size and color; I am not sure if network package in R can do this or not. The other functions I wanted have been found in that package. BTW, if there is another package in R relating to this, please suggest too. Thanks, Weiwei -- W

Re: [R] FW: FW: Unable to Plot using headers (converting to Numeric)

2011-05-27 Thread Struckmeier, Nathanael
I'll take your advise and go through the intro. Thanks Thank You Nathan Struckmeier Supply Chain Planning Office 541-864-5029 nstruckme...@harryanddavid.com 2500 S. Pacific Hwy, Medford OR, 97501 Daily Humor: Chuck Norris can slam a revolving door -Original Message- From: David Wi

Re: [R] how to add row index based a categorical column

2011-05-27 Thread Dennis Murphy
Hi: Another angle. Calling your example data frame df, df <- transform(df, Rank = with(df, ave(value, level, FUN = rank))) df[with(df, order(level, value)), ] value level Rank 3 2 A1 1 4 A2 2 5 A3 5 9 B1 410 B2 634 B3 9

Re: [R] FW: FW: Unable to Plot using headers (converting to Numeric)

2011-05-27 Thread David Winsemius
On May 27, 2011, at 5:06 PM, Struckmeier, Nathanael wrote: I tried command as.numeric(Qty)#converting column"Qty" in object "demand" to numeric. However it remains a non-numeric value. Right. You didn't assign it to anything. AND since you are apparently following the IMO misguided advi

[R] FW: FW: Unable to Plot using headers (converting to Numeric)

2011-05-27 Thread Struckmeier, Nathanael
I tried command as.numeric(Qty)#converting column"Qty" in object "demand" to numeric. However it remains a non-numeric value. What is the best way to convert a column of data to a numeric value in R? What is the best way to convert dates into a numeric format (or some format able to be used i

Re: [R] Plot rows of CSV

2011-05-27 Thread Joshua Wiley
Hi, This is not fancy or especially elegant, but ## so you can see each plot at a time before moving on par(ask = TRUE) ## apply() the function plot() to each row of the ## rows of mtcars you extracted by name apply(mtcars[c("Mazda RX4", "Merc 450SLC", "Maserati Bora"), ], 1, plot) I use as

Re: [R] Use apply on a function with multiple argument including a matrix ?

2011-05-27 Thread David Winsemius
On May 27, 2011, at 3:34 PM, sunelav wrote: Hello, I wrote a function that takes a matrix M and several numeric parameters as arguments. It returns a square matrix (same number of rows than M). I need to use this function n times (n>1000) with random parameters. Just one matrix M and ma

Re: [R] FW: Unable to Plot using headers.

2011-05-27 Thread Struckmeier, Nathanael
> is.numeric(demand) [1] FALSE > is.numeric(Qty) [1] FALSE > is.numeric(Date) [1] FALSE Doesn't look like they are numeric. I'll try and convert them and check back if I have problems. Thanks Gunter! Thank You Nathan Struckmeier Supply Chain Planning Office 541-864-5029 nstruckme...@harryanddavi

Re: [R] how to add row index based a categorical column

2011-05-27 Thread David Winsemius
On May 27, 2011, at 3:12 PM, xin wei wrote: hello, I have the following data manipulation issue. the following is the sample data: value level 4 A 5 A 2 A 10 B 9 B 34 B 100 C 34 C 101C. I hope to get the following result: value level rank 2 A

Re: [R] FW: Unable to Plot using headers.

2011-05-27 Thread Bert Gunter
Are Date and Qty numeric? Check. -- Bert On Fri, May 27, 2011 at 1:43 PM, Struckmeier, Nathanael wrote: > > -Original Message- > From: Struckmeier, Nathanael > Sent: Friday, May 27, 2011 1:39 PM > To: 'stephen's mailinglist account' > Subject: RE: [R] Unable to Plot using headers. > > Th

Re: [R] how to add row index based a categorical column

2011-05-27 Thread Joshua Wiley
Hi, This seems to work (although I have this sense that I am missing something, but I cannot put my finger on it). There are undoubtedly other ways: ## data in a form ready for copy and pasting (created using dput() ) dat <- structure(list(value = c(4L, 5L, 2L, 10L, 9L, 34L, 100L, 34L, 101L), l

[R] FW: Unable to Plot using headers.

2011-05-27 Thread Struckmeier, Nathanael
-Original Message- From: Struckmeier, Nathanael Sent: Friday, May 27, 2011 1:39 PM To: 'stephen's mailinglist account' Subject: RE: [R] Unable to Plot using headers. Thanks for the input. Despite both graphing directly and with "attach" I am still getting a screwed up graphical output as

[R] Use apply on a function with multiple argument including a matrix ?

2011-05-27 Thread sunelav
Hello, I wrote a function that takes a matrix M and several numeric parameters as arguments. It returns a square matrix (same number of rows than M). I need to use this function n times (n>1000) with random parameters. I would like to increase the speed of this computation in order to increase t

Re: [R] Count of rows while looping through data

2011-05-27 Thread jim holtman
When you subset, the factors will carry along all the original levels. You can remove them in your processing by: x$fac <- factor(x$fac) > x <- data.frame(fam=c('a','a','b'), grp=c('1','2','3')) > # split > x.s <- split(x, x$fam) > # notice additional levels > str(x.s$b) 'data.frame': 1 obs. o

Re: [R] Count of rows while looping through data

2011-05-27 Thread Phil Spector
Jeanna - The family variable is being stored as a factor. You could eliminate the NA values manually, or you could try something like x$family = as.character(x$family) before subsetting. If neither of these solutions are satisfactory, please follow the posting guide and provide a repr

Re: [R] eigenvalues and correlation matrices

2011-05-27 Thread Sarah Goslee
Hi, How about because of this: > #calculate the eigenvalues > eigen(testmatrix,symmetric = TRUE,only.value=TRUE) Your matrix isn't symmetric. If you claim that it is, R discards the upper triangle without checking. You really want this: > testmatrix <- matrix(c(2, 1, 1, 1, 3, 2, -1, 1, 2), byro

Re: [R] Unable to Plot using headers.

2011-05-27 Thread stephen's mailinglist account
On 27 May 2011 20:25, Jonathan Daily wrote: > I would caution against using attach(), however, if you are not in an > interactive session. In functions and scripts, errors can often cause > the interpreter to exit before the detach(), leaving your data on the > search path. 99% of all attach/detac

[R] how to add row index based a categorical column

2011-05-27 Thread xin wei
hello, I have the following data manipulation issue. the following is the sample data: value level 4 A 5 A 2 A 10 B 9 B 34 B 100 C 34 C 101C. I hope to get the following result: value level rank 2 A 1 4 A 2 5 A 3 9

[R] Plot rows of CSV

2011-05-27 Thread rmje
http://r.789695.n4.nabble.com/file/n3555898/example.jpg Hi, I have a CSV-file (see image) that I would like to plot. I want to make a plot-function where I only plot one row at the time. I want to define which row to plot in the function based on the row-names (non-numeric) in column 1 in the C

[R] Error with BRugs 0.53 and 0.71, on Win7 with R 2.12.2 and 2.13.0 (crashes R GUI)

2011-05-27 Thread Chris Chapman
I've run into persistent problems with OpenBUGS crashing when using BRugs .53 and .71, and am hoping someone has suggestions. There is obviously something unusual going on in my environment, but I'm at a loss as to where to begin to try to solve it. In a nutshell, what happens is that, as soon

Re: [R] Count of rows while looping through data

2011-05-27 Thread Jeanna
I may have prematurely excited... I ended up using the split method since my family indicators are alphanumeric so my issue is as follows. I'm applying this to different subsets of my main data set. The subsets do not contain all families. When I run the method on one of my subsets I get back a

[R] continuous time AR(1)

2011-05-27 Thread frossard victor
Dear R helpers, I would like to model temporal trend of biological remains in sediment cores. All samples are temporally auto-correlated and I would like to take this effect into account. Initially I thought that I could use AR(1) or ARIMA functions but these functions only work with regular tem

[R] eigenvalues and correlation matrices

2011-05-27 Thread dM/
I'm trying to test if a correlation matrix is positive semidefinite. My understanding is that a matrix is positive semidefinite if it is Hermitian and all its eigenvalues are positive. The values in my correlation matrix are real and the layout means that it is symmetric. This seems to satisfy th

[R] cluster analysis on extreme event

2011-05-27 Thread FMH
Dear all, I'm modelling extreme rainfall,particularly those that lie above a threshold & was searching for a suitable package in R which may enable a cluster analysis on those extreme events and would really appreciate for any suggestions. Thanks, Fir __

[R] Help with Rmpi install

2011-05-27 Thread Brian Mendenhall
Hello R-help! I am a systems administrator for the University of Southern California. I take care of it's general-purpose research cluster, and have recently been asked to provide access to a parallelized R platform. I do not have any previous experience using R, and have only ever had to do an

Re: [R] Speed up an R code

2011-05-27 Thread jim holtman
Take a small subset of your program that would run through the critical sections and use ?Rprof to see where some of the hot spot are. How do you know it is not using the CPU? Are you using perfmon to look what is being used? Are you paging? If you are not paging, and not doing a lot of I/O, th

Re: [R] Unable to Plot using headers.

2011-05-27 Thread Jonathan Daily
I would caution against using attach(), however, if you are not in an interactive session. In functions and scripts, errors can often cause the interpreter to exit before the detach(), leaving your data on the search path. 99% of all attach/detach cases can be handled by ?with and ?within. The issu

Re: [R] 3 Y axis possible?

2011-05-27 Thread Jun Shen
Thanks for sharing the idea, Walmes. I am also trying to add err bars to the plots. So instead of using plot(), I use errbar() from Hmisc package. Everything seems to work fine except I couldn't find the argument to control the color of error bars. If I specify col='red' in the errbar() it only co

Re: [R] Unable to Plot using headers.

2011-05-27 Thread stephen's mailinglist account
>> My data is a 2 column 8000 row table (saved as .txt file) imported into >> R. >> >>>demand=read.delim("C:\\Documents and Settings\\E066582\\My >> Documents\\R\\R-2.13.0\\bin\\demand.txt") >> >> First rows with headers are as shown: >> >>> demand[1,] >> >>        Date Qty >> >> 1 12/31/2006   1 >

Re: [R] Unable to Plot using headers.

2011-05-27 Thread Sarah Goslee
Hi, You need to tell R where to find them, since they aren't R objects. (You can see all the actual objects with ls().) Two of the many options: with(demand, plot(Qty, Date)) plot(demand$Qty, demand$Date) Sarah On Fri, May 27, 2011 at 2:35 PM, Struckmeier, Nathanael wrote: > Hello List! > >

[R] Unable to Plot using headers.

2011-05-27 Thread Struckmeier, Nathanael
Hello List! Thank you for your input so far. I have successfully imported my data into R but have hit a snag in plotting. Simple plot commands are unable to find my headers when I try and plot my data on an x/y scatter. My data is a 2 column 8000 row table (saved as .txt file) imported int

Re: [R] Speed up an R code

2011-05-27 Thread Jonathan Daily
This is a very open ended question that depends very heavily on what you are trying to do and how you are doing it. Often times, the bottleneck operations that limit speed the most are not necessarily sped up by adding RAM. They also often require special setup to run multiple operations/iterations

[R] Speed up an R code

2011-05-27 Thread Debs Majumdar
Hello,   Are there some basic things one can do to speed up a R code? I am new to R and currently going through the following situation.   I have run a R code on two different machines. I have R 2.12 installed on both.   Desktop 1 is slightly older and has a dual core processor with 4gigs of R

Re: [R] finding derivative of a data series in R

2011-05-27 Thread nandan amar
Thanks Ravi, It worked. trying to understand the features.R :) Regards On 27 May 2011 21:21, Ravi Varadhan wrote: > I am attaching a function that I have written sometime ago for extracting > some of the features of a noisy, discretely sampled times series.  In order > to extract the features,

Re: [R] "useR! 2011" T-shirt competition

2011-05-27 Thread Barry Rowlingson
On Fri, May 27, 2011 at 5:54 PM, Albyn Jones wrote: > Me too, or three! The compo page says: "Every submitted design must be the property of the submitter, who grants permission to the useR! 2011 conference to use the design on the front of T-shirts distributed to conference participants if it

Re: [R] "useR! 2011" T-shirt competition

2011-05-27 Thread Albyn Jones
Me too, or three! albyn On Fri, May 27, 2011 at 12:47:45PM -0400, Carl Witthoft wrote: > More important question: can us non-attendees buy one? > > I made myself a "UseR" t-shirt a couple yrs ago and wouldn't mind > adding to my collection. > > __ >

Re: [R] "useR! 2011" T-shirt competition

2011-05-27 Thread Carl Witthoft
More important question: can us non-attendees buy one? I made myself a "UseR" t-shirt a couple yrs ago and wouldn't mind adding to my collection. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the po

[R] lubridate, as.POSIXct and a vector of times: bug or feature??

2011-05-27 Thread James McCreight
It took me some time to realize this annoying behavior was coming from lubridate. Perhaps this behavior is unexpected a result of cursory knowledge of it ## The expected behavior > sometimes=c(0,1,2,3)*60*60*24 > as.POSIXct( sometimes, origin='1970-01-01', tz='GMT') [1] "1970-01-01 GMT" "1970-

Re: [R] How to convert an ftable object to a matrix including the row names?

2011-05-27 Thread Brian Diggs
On 5/26/2011 11:54 PM, Marius Hofert wrote: Dear Prof. Ripley, many thanks for your quick reply. A character matrix (although clearly not very elegant) would be no problem, xtable deals with that. I tried as.data.frame() before, but if one wants to have the same rows as in ft, one has to use a

Re: [R] Survival: pyears and ratetable: expected events

2011-05-27 Thread Jim Trabas
Thanks, of course I am familiar with your work. I've read 63 but I think my answer may be in 81 (reading now). I've tried running the examples I've found in the help of the survival package, they seem to work fine, but when I parse my own variables everything gets mixed up. pyears wotks fine but wh

Re: [R] finding derivative of a data series in R

2011-05-27 Thread Ravi Varadhan
I am attaching a function that I have written sometime ago for extracting some of the features of a noisy, discretely sampled times series. In order to extract the features, I first estimate the smoothed function and smoothed (first and second order) derivatives. Here is a simple demo of how t

Re: [R] RE How to convert an ftable object to a matrix including the row names?

2011-05-27 Thread Marius Hofert
Okay, great, thanks :-) Marius On 2011-05-27, at 10:56 , david.haj...@curie.net wrote: > > Hi, > > Is this what you want ? > > ft <- ftable(Titanic, row.vars=1:3) > xtable(format(ft)) > > Best, > > david > > > Marius Hofert > Envoyé par : r-help-boun...@r-project.org > 27/05/2011

[R] object not found with %dopar% when using foreach

2011-05-27 Thread Nicolas Berkowitsch
Dear R-List member, tried implement the foreach loop. It works fine, when I'm using %do%, but not when I'm using %dopar%. I always receive one of the following error messages: error in { : task 1 failed - "Objekt 'S3' not found" - could the .export be an solution for this?? Any help is muc

Re: [R] NaN, Inf to NA

2011-05-27 Thread William Dunlap
> -Original Message- > From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] > Sent: Friday, May 27, 2011 5:23 AM > To: Albert-Jan Roskam > Cc: William Dunlap; Marc Schwartz; R Mailing List > Subject: Re: [R] NaN, Inf to NA > > On 11-05-27 4:27 AM, Albert-Jan Roskam wrote: > > Aha! Thank

Re: [R] Put names in the elements of lapply result

2011-05-27 Thread Bert Gunter
Jonathan et. al: Yes, of course, but I'd say Type III error: Right answer to wrong question. The real question (imho only obviously) is: "What data structure should be used?" -- and the standard answer for this sort of thing in R is: "A list, of course." That is: myparams <- list(EMAX, EC50,KOU

Re: [R] NaN, Inf to NA

2011-05-27 Thread Martin Maechler
> Duncan Murdoch > on Fri, 27 May 2011 08:23:14 -0400 writes: > On 11-05-27 4:27 AM, Albert-Jan Roskam wrote: >> Aha! Thank you very much for that clarification! It would >> be much more user friendly if R generated a >> NotImplementedError or something similar. The 'g

Re: [R] Put names in the elements of lapply result

2011-05-27 Thread Eik Vettorazzi
yes, it is possible using sapply sapply(c('EMAX','EC50','KOUT','GAMMA'),function(x)confint(lm(get(x)~RR0,dataset2)),USE.NAMES=T,simplify=F) hth. Am 27.05.2011 16:58, schrieb Jun Shen: > Hi, Jonathan, > > It surely worked. I was only thinking how to do it within lapply and didn't > look at the pr

Re: [R] Put names in the elements of lapply result

2011-05-27 Thread Jun Shen
Hi, Jonathan, It surely worked. I was only thinking how to do it within lapply and didn't look at the problem outside the box? Thanks. Jun On Fri, May 27, 2011 at 9:47 AM, Jonathan Daily wrote: > Does this work for you? > > dat <- > lapply(c('EMAX','EC50','KOUT','GAMMA'),function(x)confint(lm(g

Re: [R] Put names in the elements of lapply result

2011-05-27 Thread Jonathan Daily
Does this work for you? dat <- lapply(c('EMAX','EC50','KOUT','GAMMA'),function(x)confint(lm(get(x)~RR0,dataset2))) names(dat) <- c('EMAX','EC50','KOUT','GAMMA') On Fri, May 27, 2011 at 10:03 AM, Jun Shen wrote: > Dear list, > > I am running some linear regressions through lapply, > >>lapply(c('

Re: [R] finding derivative of a data series in R

2011-05-27 Thread nandan amar
However if we have some discrete data set like daily temperature etc how can we can differentiate it because as.expression(D()) will not work then On 27 May 2011 16:52, nandan amar wrote: > Thanks Dennis. > I got you. > My main consern was how to differentiate a series correctly. > I think the fi

[R] Put names in the elements of lapply result

2011-05-27 Thread Jun Shen
Dear list, I am running some linear regressions through lapply, >lapply(c('EMAX','EC50','KOUT','GAMMA'),function(x)confint(lm(get(x)~RR0,dataset2))) I got results like [[1]] 2.5 % 97.5 % (Intercept) 0.6595789212 0.8821691261 RR0 -0.0001801771 0.0001489083 [[2

Re: [R] Applying "toupper" to only portions of text strings

2011-05-27 Thread Eik Vettorazzi
or even shorter TEXT<- c("", "bbb|cc", "|ddd") gsub("(^.*[|])","\\U\\1",TEXT,perl=T) Am 27.05.2011 00:24, schrieb Phil Spector: > Dennis - > Here's one way, using a somewhat obscure feature of perl > regular expressions, i.e. the \U and \L escape characters which > modify the case o

[R] How to process raw trip records to get number of persons per trip by vehicle

2011-05-27 Thread Walter Anderson
I have a large data set containing travel records for a para-transit system. There is one record for each person transported, that contains the following information: Vehicle.IdCustomer.IdTrip.DateTimeOnTimeOffFare W36 1 2009.07.01

Re: [R] error message %1 is not a valid Win32 application.

2011-05-27 Thread sivan aldor
thank you. On my friends computer I did get a popup message regarding matlab which made sense (since he does not have matlab installed). I will check out the "Dependency Walker". Sivan On Fri, May 27, 2011 at 2:12 AM, Prof Brian Ripley wrote: > On Thu, 26 May 2011, Duncan Murdoch wrote: > > On 1

Re: [R] errorest of library iprde: specifiying parameters for regularized DA

2011-05-27 Thread Uwe Ligges
On 27.05.2011 11:55, Felix Bach wrote: Hi dear R users, I am using the function errorest from the libbrary ipred to estimate the 10 fold and bootstrap classification error rate using regularized discriminat function analysis (functiopn rda from library klaR). Is it possible to set my own va

Re: [R] R-Size Limit (Confused)

2011-05-27 Thread Orvalho Augusto
I do not know what problem might be. But I recommend to go back to the excel file, import it into MS Access. Then make an ODBC connection to the access file. From which you will connect from R using RODBC. Caveman On Thu, May 26, 2011 at 11:59 PM, David Winsemius wrote: > > On May 26, 2011, at 5

Re: [R] Survival: pyears and ratetable: expected events

2011-05-27 Thread Terry Therneau
>I am having a (really) hard time getting pyears to work together with a > ratetable to give me the number of expected events (deaths). The most complete discussion of pyears and rate tables is in a technical report from the Biostatistics group at Mayo http://mayoresearch.mayo.edu/mayo/researc

[R] mediate

2011-05-27 Thread Mervi Virtanen
Hi! I try to do multiple mediation model where is two mediators but one dependent and one independent variable: med.total <- mediate(c(model.m1,model.m2), model.y, treat="skill", boot=TRUE, sims=1000,mediator=c("dev","irr")) but it isn't work! Could anyone help me? t.Mete __

Re: [R] Suppress intermediate results on console

2011-05-27 Thread David Winsemius
On May 26, 2011, at 3:23 PM, Lisa wrote: Thanks for your comments and suggestion. I didn’t show all my own function here because it has many lines. “x” is the results of another function. I am calling summary because I want to extract some values from the results. Some of the summary fun

Re: [R] Suppress intermediate results on console

2011-05-27 Thread Jonathan Daily
If you want to extract values from without printing, use indexing. Check ?`[` for various ways to extract values. These, of course, depend on what x is, which you have still not provided. This is also fairly basic and covered in the introduction to R. Have you read it? If not, you should do so bef

Re: [R] NaN, Inf to NA

2011-05-27 Thread Duncan Murdoch
On 11-05-27 4:27 AM, Albert-Jan Roskam wrote: Aha! Thank you very much for that clarification! It would be much more user friendly if R generated a NotImplementedError or something similar. The 'garbage results' are pretty misleading, esp. to a novice. I think that's a good idea. The default m

Re: [R] lattice - change background strip color in one panel

2011-05-27 Thread P Ehlers
On 2011-05-27 0:48, Coen van Hasselt wrote: Hello, I would like to change the background color in only -one- of the strips in a multipanel lattice xyplot, from the default yellow-brown color. Until now, I only managed to change the background strip color in all of the strips using the par.settin

Re: [R] NaN, Inf to NA

2011-05-27 Thread Kenn Konstabel
On Fri, May 27, 2011 at 11:27 AM, Albert-Jan Roskam wrote: > Aha! Thank you very much for that clarification! It would be much more user > friendly if R generated a NotImplementedError or something similar. The > 'garbage > results' are pretty misleading, esp. to a novice. > > I wanted to recode

Re: [R] text mining

2011-05-27 Thread rgui
Thanks very well -- View this message in context: http://r.789695.n4.nabble.com/text-mining-tp3552221p3554849.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-hel

[R] stinterp/spline - uniroot problem

2011-05-27 Thread merhardt
Dear all, I would like to fit growth data to a smooth curve (preferably using a Stineman interpolation). Then I would like to find the intersection of the curve with a horizontal line (e.g. 0). See below for a coding example. The root finding using 'uniroot' works fine if I fit the data with 'smo

[R] errorest of library iprde: specifiying parameters for regularized DA

2011-05-27 Thread Felix Bach
Hi dear R users, I am using the function errorest from the libbrary ipred to estimate the 10 fold and bootstrap classification error rate using regularized discriminat function analysis (functiopn rda from library klaR). Is it possible to set my own values for gamma and lambda? Any help will b

Re: [R] "useR! 2011" T-shirt competition

2011-05-27 Thread Jose-Marcio Martins da Cruz
David Firth wrote: Dear R users: It is planned that participants in the R User Conference, useR! 2011 (August 16-18, http://R-project.org/useR-2011) will each receive a Better : http://www.R-project.org/useR-2011 __ R-help@r-project.org mailin

[R] Plot mismatch distributions in R

2011-05-27 Thread andraLia
Does anyone know how to plot mismatch distributions in R, in order to look similar to : http://mbe.oxfordjournals.org/content/20/1/76/F7.large.jpg -- View this message in context: http://r.789695.n4.nabble.com/Plot-mismatch-distributions-in-R-tp3554850p3554850.html Sent from the R help mailing

Re: [R] Subset command and the : operator

2011-05-27 Thread jim holtman
What you are probably looking for is the %in% operator: with(mydata, sum(table(X1[X2 %in% 5:8]))) Read up on how operations are vectorized and how variables are recycled if not long enough > x <- 1:10 > x == 1:2 # compares first two fine [1] TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FAL

[R] "useR! 2011" T-shirt competition

2011-05-27 Thread David Firth
Dear R users: We are looking for a new design for the front of the "useR! 2011" conference T-shirt, and we invite submissions by June 13. It is planned that participants in the R User Conference, useR! 2011 (August 16-18, http://R-project.org/useR-2011) will each receive a T-shirt, thanks to th

Re: [R] Help to improve existing R-Code

2011-05-27 Thread Michael Haenlein
I'm looking to hire someone -- sorry for not having been more precise! Michael On Fri, May 27, 2011 at 1:23 PM, Duncan Murdoch wrote: > On 11-05-27 3:23 AM, Michael Haenlein wrote: > >> Dear all, >> >> I have written a relatively brief R-Code to run a series of simulations. >> Currently the code

Re: [R] Help to improve existing R-Code

2011-05-27 Thread Duncan Murdoch
On 11-05-27 3:23 AM, Michael Haenlein wrote: Dear all, I have written a relatively brief R-Code to run a series of simulations. Currently the code runs for a very long time (up to several days, depending on the conditions) and I expect this to be the case because it might not be very efficiently

Re: [R] finding derivative of a data series in R

2011-05-27 Thread nandan amar
Thanks Dennis. I got you. My main consern was how to differentiate a series correctly. I think the first procedure is more accurate. Regards. On 27 May 2011 16:27, Dennis Murphy wrote: > Hi: > > A function and its spline approximation are not equivalent functions, > hence neither are their corres

[R] Subset command and the : operator

2011-05-27 Thread Chris Beeley
Hello- I have some code that looks like this: with(mydatalocal, sum(table(Service[Time==5:8]))) This is designed to add up the numbers of responses between the Time codes 5 to 8 (which are integers and refer to quarters). Service is just one of the variables, I'm just trying to count the number

Re: [R] NaN, Inf to NA

2011-05-27 Thread Albert-Jan Roskam
Aha! Thank you very much for that clarification! It would be much more user friendly if R generated a NotImplementedError or something similar. The 'garbage results' are pretty misleading, esp. to a novice. I wanted to recode every NaN and Inf value of an entire data.frame to NA. The data.fram

Re: [R] How to convert an ftable object to a matrix including the row names?

2011-05-27 Thread Dennis Murphy
Hi: Use can use dcast() from the reshape2 package: library(reshape2) > dcast(ft.df, Class + Sex + Age ~ Survived) Using Freq as value column: use value_var to override. ClassSex Age No Yes 11st Male Child 0 5 21st Male Adult 118 57 31st Female Child 0 1 41st

[R] finding derivative of a data series in R

2011-05-27 Thread nandan amar
Dear All, I tried following for getting derivative of a polynomial in R i<- -10:10 x<-i*i*i+3*i*i+2 fun_spline<-splinefun(i,x) plot(x,type="l") lines(x,fx_spline(x, deriv=1), col='green') lines(x,fx_spline(x, deriv=2), col='green') Now when I plot 3*i*i + 6*i and 6*i + 6 the plot was not same for

  1   2   >