Re: [R] Assigning week numbers

2010-04-22 Thread Gustaf Rydevik
On Wed, Apr 21, 2010 at 6:50 PM, Michael Hosack wrote: > > > I provided a minimized version of my dataframe at the bottom of this message > containing the results of David's code in variable ('wkoffset') and Jeff > Hallman's code in ('WEEK'). Jeff's code produced the correct results (thank > yo

Re: [R] long output in R

2010-04-22 Thread Patrick Burns
There are at least two functions that may be of interest to you in this regard: 'head' (there is also 'tail') 'page' On 21/04/2010 23:01, Mingfeng Lin wrote: Hello all: Is there a way to set up R such that, when you have a very long output from a command, it will pause when it has displayed on

Re: [R] R crashing oddly

2010-04-22 Thread Viechtbauer Wolfgang (STAT)
A similar problem was mentioned before: https://stat.ethz.ch/pipermail/r-sig-mixed-models/2008q3/001425.html There appears to be a bug in the C code leading to memory corruption. Best, -- Wolfgang Viechtbauerhttp://www.wvbauer.com/ Department of Methodology and Statistic

Re: [R] Huge data sets and RAM problems

2010-04-22 Thread Stella Pachidi
Dear all, Thank you very much for your replies and help. I will try to work with your suggestions and come back to you if I need something more. Kind regards, Stella Pachidi On Thu, Apr 22, 2010 at 5:30 AM, kMan wrote: > You set records to NULL perhaps (delete, shift up). Perhaps your system is

Re: [R] time difference

2010-04-22 Thread jim holtman
?strptime Read the documentation and you will find reference to "%OSn" > x <- strptime('13:45:34.123', format="%H:%M:%OS") > x [1] "2010-04-22 13:45:34" > format(x, format="%H:%M:%OS3") [1] "13:45:34.123" > On Thu, Apr 22, 2010 at 2:58 AM, Carol Gao wrote: > Hi, > > Does anyone know how to ta

[R] time series' year not recognized

2010-04-22 Thread Sara Szeremeta
I am working with time series and I have encountered a problem with R not recognizing a series properly. I can do the tests and fitting, but when I want to decompose the series I got a message: d<-decompose(data) Error in decompose(dane) : time series has no or less than 2 periods Maybe I have ma

[R] Convert character string to top levels + NAN

2010-04-22 Thread Michael Haenlein
Dear all, I have several character strings with a high number of different levels. unique(x) gives me values in the range of 100-200. This creates problems as I would like to use them as predictors in a coxph model. I therefore would like to convert each of these strings to a new string (x_new).

[R] R 2.11.0 is released

2010-04-22 Thread Peter Dalgaard
I've rolled up R-2.11.0.tar.gz a short while ago. This is a development release which contains a number of new features. Also, a number of mostly minor bugs have been fixed. See the full list of changes below. NOTE: The build platform has been changed for this release. Please watch out extra car

Re: [R] time difference

2010-04-22 Thread Stefan
Carol Gao gmail.com> writes: > > Hi, > > Does anyone know how to take a time difference when the format of the time > is as 13:22:23.586? I am trying to take the difference of time between stock > transactions and need to keep the three decimal places for seconds. I have > tried *diff(strptime(

Re: [R] overlaying a levelplot on a map plot

2010-04-22 Thread Simon Goodman
Thanks for the suggestions Unfortunately contour won't in this case as it expects the x,y values to be in an ascending sequence. -- View this message in context: http://r.789695.n4.nabble.com/overlaying-a-levelplot-on-a-map-plot-tp2019419p2020292.html Sent from the R help mailing list ar

[R] R2.11.0 - rasterImage() and barplot fill-patterns

2010-04-22 Thread Tal Galili
Hello Peter, Thank you, and the R core team, for the new release. I see that in R 2.11.0 there is now support for rendering of raster (bitmap) images through rasterImage(). I am wondering - can this be used to create a texture/fill-pattern for hist()/barplot() ? (A request made several times th

[R] install or uncompress package build in one platform in another platform

2010-04-22 Thread carol white
Hi, Is an R package built under Unix (package.tar.gz) could be installed on other platforms like windows or Mac? The compressed tar file (.tar.gz) built under Unix doesn't seem to be uncompressed under windows (unzip under windows instead of gunzip). How to proceed? Look forward to your reply,

[R] Help with tapply selection

2010-04-22 Thread Ronaldo Reis Junior
Hi, I try to create a data.frame from results of a tapply. I have this results from tapply: -- , , tapinom sp 1 1 2 3 4 5 6 7 8 9 10 1 NA NA NA NA NA NA NA NA NA NA 4 NA NA NA NA NA NA NA NA NA 4 5 NA NA NA NA NA NA NA NA NA NA 6 NA NA NA NA NA NA NA NA NA NA

Re: [R] Convert character string to top levels + NAN

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 5:16 AM, Michael Haenlein wrote: Dear all, I have several character strings with a high number of different levels. unique(x) gives me values in the range of 100-200. This creates problems as I would like to use them as predictors in a coxph model. I therefore would

Re: [R] Help with tapply selection

2010-04-22 Thread Henrique Dallazuanna
Try this: as.vector(tapply(...)) On Thu, Apr 22, 2010 at 9:47 AM, Ronaldo Reis Junior wrote: > Hi, > > I try to create a data.frame from results of a tapply. > > I have this results from tapply: > -- > , , tapinom sp 1 > >1 2 3 4 5 6 7 8 9 10 > 1 NA NA NA NA N

Re: [R] question on rpart

2010-04-22 Thread Terry Therneau
--- Begin included message I have attempted to email the author of this package without success, just wondering if anybody else has experienced this. I am having an using rpart on 4000 rows of data with 13 attributes. I can run the same test on 300 rows of the same data with no issue. When I run

Re: [R] install or uncompress package build in one platform in another platform

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 8:09 AM, carol white wrote: Hi, Is an R package built under Unix (package.tar.gz) could be installed on other platforms like windows or Mac? The compressed tar file (.tar.gz) built under Unix doesn't seem to be uncompressed under windows (unzip under windows instead of

Re: [R] overlaying a levelplot on a map plot

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 5:33 AM, Simon Goodman wrote: Thanks for the suggestions Unfortunately contour won't in this case as it expects the x,y values to be in an ascending sequence. ?order David Winsemius, MD West Hartford, CT __ R-help@r

[R] Compare two data frames

2010-04-22 Thread Doran, Harold
I wonder if there is a more efficient way to do this task. Suppose I have two data frames, such as d1 <- data.frame(x = c(1,2,3), y = c(4,5,6), z = c(7,8,9)) d2 <- d1[, c('y', 'x')] The first dataframe d1 has more variables than d2 and the variable columns are in a different order. So, what I

Re: [R] How to stamp my graphs with date and time

2010-04-22 Thread Kevin Wright
Jun, I created a function called "pageNum" that does exactly what you want for both 'base' and 'lattice' graphics. You can find it here: http://ryouready.wordpress.com/2009/02/17/r-good-practice-adding-footnotes-to-graphics/ Kevin On Wed, Apr 21, 2010 at 7:23 PM, Jun Shen wrote: > David, Dun

Re: [R] R2.11.0 - rasterImage() and barplot fill-patterns

2010-04-22 Thread baptiste auguie
Hi, This idea was also discussed when Paul Murrell first announced the grid.raster function to R-devel, http://tolstoy.newcastle.edu.au/R/e8/devel/09/12/0912.html My personal conclusion was that vector fill patterns are generally better in terms of resolution and speed. Of course the situation mi

Re: [R] Compare two data frames

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 9:41 AM, Doran, Harold wrote: I wonder if there is a more efficient way to do this task. Suppose I have two data frames, such as d1 <- data.frame(x = c(1,2,3), y = c(4,5,6), z = c(7,8,9)) d2 <- d1[, c('y', 'x')] The first dataframe d1 has more variables than d2 and the

Re: [R] install or uncompress package build in one platform in another platform

2010-04-22 Thread Uwe Ligges
On 22.04.2010 15:34, David Winsemius wrote: On Apr 22, 2010, at 8:09 AM, carol white wrote: Hi, Is an R package built under Unix (package.tar.gz) could be installed on other platforms like windows or Mac? The compressed tar file (.tar.gz) built under Unix doesn't seem to be uncompressed unde

Re: [R] install or uncompress package build in one platform in another platform

2010-04-22 Thread Duncan Murdoch
On 22/04/2010 8:09 AM, carol white wrote: Hi, Is an R package built under Unix (package.tar.gz) could be installed on other platforms like windows or Mac? The compressed tar file (.tar.gz) built under Unix doesn't seem to be uncompressed under windows (unzip under windows instead of gunzip). H

Re: [R] densCols: what are the computed densities and how to create a legend

2010-04-22 Thread Florian Hahne
Hi Kate, the function does not directly return the calculated density values, however those can be recomputed through the internal function .smoothScatterCalcDensity This function is not exported from the grDevices name space, so you need to use the full qualifier: dat <- cbind(rnorm(100), rnorm

Re: [R] Jonckheere-Terpstra test using coin package?

2010-04-22 Thread GlenB
I am unfamiliar with how to use coin, but it looks like it should be doable - the vignette in coin.pdf does a Page test. The wikipedia page for Page's test explains how this is related to the Jonckheere-Terpstra test, which seems to suggest if it can do one it should be able to do the other. Add t

Re: [R] R loop.

2010-04-22 Thread mhalsham
Thanks a lot for the help, but it’s not what I needed. -- View this message in context: http://r.789695.n4.nabble.com/R-loop-tp1979620p2020386.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https:/

[R] Amusing coincidence

2010-04-22 Thread peter dalgaard
...that this Danish movie would have an official release today: http://www.imdb.com/title/tt1434443/ http://filmz.dk/film/r/trailers/24836 -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk

[R] compare variables and take largest value?

2010-04-22 Thread Vlatka Matkovic Puljic
Hi! I have v1, v2 and v3 (data in v. ranges 1 to 4) v1 [1] 1 1 1 1 NaN 1 1 4 1 1 3 v2 [1] 1 1 1 1 1 1 1 1 1 1 1 v3 [1] 1 1 1 1 1 1 1 1 1 1 1 I want R to compare entries in v1,v2,v3 and in v4 to put largest value (NA=0). For

Re: [R] compare variables and take largest value?

2010-04-22 Thread Duncan Murdoch
On 22/04/2010 11:07 AM, Vlatka Matkovic Puljic wrote: Hi! I have v1, v2 and v3 (data in v. ranges 1 to 4) v1 [1] 1 1 1 1 NaN 1 1 4 1 1 3 v2 [1] 1 1 1 1 1 1 1 1 1 1 1 v3 [1] 1 1 1 1 1 1 1 1 1 1 1 I want R to compare entrie

[R] cell-based high-throughput chemical compound screens package?

2010-04-22 Thread Zoppoli, Gabriele (NIH/NCI) [G]
Hi I'm looking for a package to perform quality control, normalization and analysis of high throughput cell-base chemical screens. I know that the cellHTS2 package provides this for siRNA screens. Does anybody know if something like what I'm looking for exists? Thank you! Gabriele Zoppoli,

Re: [R] compare variables and take largest value?

2010-04-22 Thread Vlatka Matkovic Puljic
Thanx a lot! That's it! 2010/4/22 Duncan Murdoch > On 22/04/2010 11:07 AM, Vlatka Matkovic Puljic wrote: > >> Hi! >> >> I have v1, v2 and v3 (data in v. ranges 1 to 4) >> >> v1 >> [1] 1 1 1 1 NaN 1 1 4 1 1 3 >> v2 >> [1] 1 1 1 1 1 1 1 1 1 1 1 >> v3 >

Re: [R] Amusing coincidence

2010-04-22 Thread Barry Rowlingson
On Thu, Apr 22, 2010 at 3:27 PM, peter dalgaard wrote: > ...that this Danish movie would have an official release today: > > http://www.imdb.com/title/tt1434443/ Does it have music by this composer: http://www.imdb.com/name/nm1731203/ and stills photography by: http://www.imdb.com/name/nm208

[R] using which to select range of values

2010-04-22 Thread Muhammad Rahiz
Hi all, I would like to get the array index for a range of values, say 0 < x < 1.5. I'm wondering if there is an alternative for the following which I've done x0 <- rnorm(100) x1 <- ifelse(x0 > 0 & x0 < 1.5,"t","f") x2 <- which(x1=="t",arr.ind=TRUE) x0[x2] Thanks. -- Muhammad ___

Re: [R] compare variables and take largest value?

2010-04-22 Thread Vlatka Matkovic Puljic
Only thing that when I put na.rm=FALSE, R is puting in v4 NA (as is largest) and I want to see NA as zero (0, smallest value) 2010/4/22 Vlatka Matkovic Puljic > Thanx a lot! That's it! > > 2010/4/22 Duncan Murdoch > > On 22/04/2010 11:07 AM, Vlatka Matkovic Puljic wrote: >> >>> Hi! >>> >>> I h

Re: [R] Amusing coincidence

2010-04-22 Thread Ted Harding
On 22-Apr-10 15:19:45, Barry Rowlingson wrote: > On Thu, Apr 22, 2010 at 3:27 PM, peter dalgaard > wrote: >> ...that this Danish movie would have an official release today: >> >> http://www.imdb.com/title/tt1434443/ > > Does it have music by this composer: > > http://www.imdb.com/name/nm1731203

Re: [R] using which to select range of values

2010-04-22 Thread Steve Lianoglou
Hi, On Thu, Apr 22, 2010 at 11:21 AM, Muhammad Rahiz wrote: > Hi all, > > I would like to get the array index for a range of values, say  0 < x < 1.5. > I'm wondering if there is an alternative for the following which I've done > > x0 <- rnorm(100) > x1 <- ifelse(x0 > 0 & x0 < 1.5,"t","f") > x2 <

Re: [R] using which to select range of values

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 11:39 AM, Steve Lianoglou wrote: Hi, On Thu, Apr 22, 2010 at 11:21 AM, Muhammad Rahiz wrote: Hi all, I would like to get the array index for a range of values, say 0 < x < 1.5. I'm wondering if there is an alternative for the following which I've done x0 <- rnorm(

Re: [R] using which to select range of values

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 11:21 AM, Muhammad Rahiz wrote: Hi all, I would like to get the array index for a range of values, say 0 < x < 1.5. I'm wondering if there is an alternative for the following which I've done x0 <- rnorm(100) x1 <- ifelse(x0 > 0 & x0 < 1.5,"t","f") x2 <- which(x1=="t"

[R] macro variable in R?

2010-04-22 Thread karena
I need to create 10 matrices. say matrix 1-10. matrix_1 is 1 by 1 matrix_2 is 2 by 2 matrix_3 is 3 by 3 . . . matrix_10 is 10 by 10 I am just wondering if there are some functions in R that are similar to the macro variables in SAS. so I can create these 10 matrices by doing: for (i in

[R] Multicolor main title in a plot or mtext

2010-04-22 Thread Ottorino-Luca Pantani
Dear R-users, the problem I'm facing today is to write a multicolor main title in a plot. I would like to have 3/4 colors to help people in the audience to visually realize what is what in a 4x2 plot array On top of each plot I would like to have two lines. The 1st line will indicate what is plo

Re: [R] macro variable in R?

2010-04-22 Thread Mario Valle
Why don't use a list? m <- list() for(i in 1:10) { m[[i]] <- matrix(NA, i, i) } then access them as m[[7]][1,6] Ciao! mario On 22-Apr-10 18:08, karena wrote: I need to create 10 matrices. say matrix 1-10. matrix_1 is 1 by 1 matrix_2 is 2 by 2 matrix_3 is 3 by 3 . .

Re: [R] macro variable in R?

2010-04-22 Thread Benilton Carvalho
maybe for (i in 1:10) assign(paste("matrix", i, sep="_"), matrix(nrow=i, ncol=i)) suffices? On Thu, Apr 22, 2010 at 5:08 PM, karena wrote: > > I need to create 10 matrices. say matrix 1-10. > > matrix_1 is 1 by 1 > matrix_2 is 2 by 2 > matrix_3 is 3 by 3 >   . >   . >   . > matrix_10 is 10 by 1

Re: [R] macro variable in R?

2010-04-22 Thread Steve Lianoglou
Hi, On Thu, Apr 22, 2010 at 12:08 PM, karena wrote: > > I need to create 10 matrices. say matrix 1-10. > > matrix_1 is 1 by 1 > matrix_2 is 2 by 2 > matrix_3 is 3 by 3 >   . >   . >   . > matrix_10 is 10 by 10 > > I am just wondering if there are some functions in R that are similar to the > macr

Re: [R] R loop.

2010-04-22 Thread jim holtman
You did not give a good description of your problem, or what you wanted as a solution (what is a 'button'), or a reasonable idea of what you data is. Here is one solution x <- read.table(textConnection("Deafness, EYA4, DIAPH1, MYO7A, TECTA, COL11A2, POU4F3, MYH9, ACTG1, MYO6"), as.is=TRUE, se

[R] Arima online forecasting

2010-04-22 Thread Matteo Bertini
I'd like to have an online horizon=k forecast with Arima, something like: library(forecast) air.model = Arima(AirPassengers[0:100], c(1,0,1), seasonal=list(order=c(0,1,1), period=12)) for(i in 0:(length(AirPassengers)-100)) { air.model2 = Arima(AirPassengers[0:(100+i)], model=air.model)

[R] Error in plotting non-linear regression

2010-04-22 Thread Muhammad Rahiz
Hello everyone, I'm trying to draw the non-linear regression curve to look at the distance decay relationship between distance and correlation values. But I'm not able to plot the curve as I'm struggling with the following error ("parameters without starting value in 'data': x") and found no

Re: [R] macro variable in R?

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 12:24 PM, Steve Lianoglou wrote: Hi, On Thu, Apr 22, 2010 at 12:08 PM, karena wrote: I need to create 10 matrices. say matrix 1-10. matrix_1 is 1 by 1 matrix_2 is 2 by 2 matrix_3 is 3 by 3 . . . matrix_10 is 10 by 10 I am just wondering if there are some function

Re: [R] R crashing oddly

2010-04-22 Thread Michael Steven Rooney
Hi Uwe, I downloaded R 2.11.0 and the latest version of nlme. I am still getting the problem. I should also note that I got a message from Viechtbauer Wolfgang saying that he had experienced a similar problem using nlme. I have pasted the code below. (The data is generated in the first ~15 lines)

[R] simple question

2010-04-22 Thread Zoppoli, Gabriele (NIH/NCI) [G]
Hi how can I find, in a vector of characters, which is the most frequent one? Thanks Gabriele Zoppoli, MD Ph.D. Fellow, Experimental and Clinical Oncology and Hematology, University of Genova, Genova, Italy Guest Researcher, LMP, NCI, NIH, Bethesda MD Work: 301-451-8575 Mobile: 301-204-5642 Em

Re: [R] Error in plotting non-linear regression

2010-04-22 Thread Peter Ehlers
On 2010-04-22 11:09, Muhammad Rahiz wrote: Hello everyone, I'm trying to draw the non-linear regression curve to look at the distance decay relationship between distance and correlation values. But I'm not able to plot the curve as I'm struggling with the following error ("parameters without sta

Re: [R] Amusing coincidence

2010-04-22 Thread Marc Schwartz
On Apr 22, 2010, at 10:34 AM, Ted Harding wrote: > On 22-Apr-10 15:19:45, Barry Rowlingson wrote: >> On Thu, Apr 22, 2010 at 3:27 PM, peter dalgaard >> wrote: >>> ...that this Danish movie would have an official release today: >>> >>> http://www.imdb.com/title/tt1434443/ >> >> Does it have musi

Re: [R] simple question

2010-04-22 Thread Joshua Wiley
Hello, What about test <- c(rep(c("A","C","G","T"), 20),"C") table(test) I am not sure that is an apt representation of the data and problem you are trying to solve. It also occurred to me that each character may not be its own element in the vector. If that is so, you would need to do somethi

Re: [R] simple question

2010-04-22 Thread Muhammad Rahiz
Hi Gabriele, This is one way but I'm sure that there is an optimal way of doing so... x <- c("A","B","C","C","C","C","C","B","B") name <- unique(x) # get unique characters freq <- c() for (a in 1:length(name)){ freq[a] <- sum(x==name[a])}# get frequency out <- cbind(name,freq)

Re: [R] simple question

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 1:36 PM, Zoppoli, Gabriele (NIH/NCI) [G] wrote: Hi how can I find, in a vector of characters, which is the most frequent one? > a <- sample(letters[1:10], 100, replace=TRUE) > table(a) a a b c d e f g h i j 10 7 7 13 7 12 1 14 15 14 > max(table(a)) [1] 15

Re: [R] Error in plotting non-linear regression

2010-04-22 Thread Muhammad Rahiz
It now works. Thanks both. Muhammad Peter Ehlers wrote: On 2010-04-22 11:09, Muhammad Rahiz wrote: Hello everyone, I'm trying to draw the non-linear regression curve to look at the distance decay relationship between distance and correlation values. But I'm not able to plot the curve a

Re: [R] simple question

2010-04-22 Thread Lee.Adams
Gabriele - How about this: > data<-c("A","A","A","B","B","C","D") > data [1] "A" "A" "A" "B" "B" "C" "D" > table(data) data A B C D 3 2 1 1 Thanks, Lee ". . . people who focus only on 'what is' will create more of 'what is.' People who focus mostly on 'what could be' will begin to create 'wh

Re: [R] overlaying a levelplot on a map plot

2010-04-22 Thread Kevin Wright
Mixing base/lattice graphics can be tricky, but is possible. http://www.bioconductor.org/CRAN/web/packages/gridBase/vignettes/gridBase.pdf Also, did you look at Chapter 13 of the lattice book? http://lmdvr.r-forge.r-project.org/figures/figures.html Kevin On Wed, Apr 21, 2010 at 2:08 PM, David

Re: [R] compare variables and take largest value?

2010-04-22 Thread Henrique Dallazuanna
Try this: apply(replace(v <- rbind(v1, v2, v3), is.nan(v), 0), 2, max) On Thu, Apr 22, 2010 at 12:24 PM, Vlatka Matkovic Puljic < v.matkovic.pul...@gmail.com> wrote: > Only thing that when I put na.rm=FALSE, > R is puting in v4 NA (as is largest) > and I want to see NA as zero (0, smallest val

Re: [R] Multicolor main title in a plot or mtext

2010-04-22 Thread Kevin Wright
Perhaps this helps? http://blog.revolution-computing.com/2009/01/multicolor-text-in-r.html Kevin On Thu, Apr 22, 2010 at 11:18 AM, Ottorino-Luca Pantani < ottorino-luca.pant...@unifi.it> wrote: > Dear R-users, the problem I'm facing today is to write a > multicolor main title in a plot. > > I w

[R] Accessing outside data sources for stock data?

2010-04-22 Thread Brigid Mooney
Hi All, I apologize if this is not the right forum for this question. I know there used to be a package for R that connected to opentick's (open source) stock market data. However, opentick closed up about a year ago. Does anyone know of a similar package that connects to IQfeed's stock market

Re: [R] overlaying a levelplot on a map plot

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 2:24 PM, Kevin Wright wrote: Mixing base/lattice graphics can be tricky, but is possible. http://www.bioconductor.org/CRAN/web/packages/gridBase/vignettes/gridBase.pdf That could be quite useful in the future. Thanks for that. Also, did you look at Chapter 13 of the la

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

2010-04-22 Thread Paul Miller
Hello Everyone,   My company purchased S-Plus before it was bought out by Tibco. My understanding is that we own version 7.0 outright.   So far, I've been learning in R but thought I might also try working in S-Plus. My understanding is that S-Plus has some useful extra features. Another potent

[R] read.table understands comment field and ignores text

2010-04-22 Thread Jack T.
Hi I'm trying to import a large csv file without quotes around each field. This creates some problems when there are "#" characters in certain strings as R understands its comment field and ignores the rest of the line. Here's an example: var1, var2, var3, var4 one, two, three, four Use this

Re: [R] read.table understands comment field and ignores text

2010-04-22 Thread Marc Schwartz
On Apr 22, 2010, at 2:05 PM, Jack T. wrote: > > Hi I'm trying to import a large csv file without quotes around each field. > This creates some problems when there are "#" characters in certain strings > as R understands its comment field and ignores the rest of the line. > > Here's an example:

Re: [R] read.table understands comment field and ignores text

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 3:05 PM, Jack T. wrote: Hi I'm trying to import a large csv file without quotes around each field. This creates some problems when there are "#" characters in certain strings as R understands its comment field and ignores the rest of the line. Here's an example: var1

Re: [R] read.table understands comment field and ignores text

2010-04-22 Thread Jack T.
Oh man, totally missed that one! Thanks so much for the reminder. -- View this message in context: http://r.789695.n4.nabble.com/read-table-understands-comment-field-and-ignores-text-tp2021036p2021055.html Sent from the R help mailing list archive at Nabble.com. ___

[R] mixed model with subject-specific variance structure

2010-04-22 Thread Jiang, Yonghua
Hi All, I built a mixed model with subject-specific variance structure in SAS and it works quite well. Now I intended to implement the same model in R using lme with "weights" option. Following is the SAS code and the corresponding R code: SAS: proc mixed data=source; class id trial group valen

[R] What is the test statistics in perm.test

2010-04-22 Thread Xiang Gao
Hi, The permutation test for two samples in R is function perm.test(). I could not figure out what is the statistics it estimate and how many permutation it did in default? Thanks, [[alternative HTML version deleted]] __ R-help@r-project.org m

[R] index ordering

2010-04-22 Thread tamas barjak
Hi All! I have a problem that I do not know it how it is necessary to query an index belonging to a given value. Somebody would help? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listin

Re: [R] index ordering

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 3:45 PM, tamas barjak wrote: Hi All! I have a problem that I do not know it how it is necessary to query an index belonging to a given value. I bit hard to tell without an example but suspect you want: ?which -- David Winsemius, MD West Hartford, CT ___

Re: [R] Compare two data frames

2010-04-22 Thread Paul Murrell
Hi Sounds like the 'compare' package might do some of what you want. Paul On 23/04/2010 1:41 a.m., Doran, Harold wrote: I wonder if there is a more efficient way to do this task. Suppose I have two data frames, such as d1<- data.frame(x = c(1,2,3), y = c(4,5,6), z = c(7,8,9)) d2<- d1[, c('y'

Re: [R] R2.11.0 - rasterImage() and barplot fill-patterns

2010-04-22 Thread Paul Murrell
Hi On 23/04/2010 12:10 a.m., Tal Galili wrote: Hello Peter, Thank you, and the R core team, for the new release. I see that in R 2.11.0 there is now support for rendering of raster (bitmap) images through rasterImage(). I am wondering - can this be used to create a texture/fill-pattern for hi

Re: [R] index ordering

2010-04-22 Thread Tal Galili
Ah. Close to what David suggested... Try: ?which.max Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English

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

2010-04-22 Thread John James
Paul Just as in your implied analogy there are significant differences beneath the surface between these programs despite superficial similarities. You will soon get frustrated trying to use both simultaneously as you will not be sure that the critical step you've discovered in one will wor

Re: [R] overlaying a levelplot on a map plot

2010-04-22 Thread Simon Goodman
Thanks for those pointers making some progress now The following will put the levelplot on to the map, but the not with the co-ordinates aligned... The level plot appears on a slightly larger scale compared to the underlying map. In both the map and levelplot, the coordinates are in lon, lat

Re: [R] Compare two data frames

2010-04-22 Thread Bert Gunter
Why does: nm <- intersect(names(d1),names(d2)) identical(d1[,nm], d2[,nm]) not do it? -- Bert Bert Gunter Nonclinical Biostatistics 467-7374 http://devo.gene.com/groups/devo/depts/ncb/home.shtml -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-proje

[R] How to insert gridlines in lattice density plot

2010-04-22 Thread Giles
Greetings. How can I insert gridlines in the following density plot call? Must one compose a panel function? 'data.frame': 46 obs. of 2 variables: $ fallrates: num 5.2 7.1 7.1 9.8 3.7 7.5 5 6.2 1.5 2.9 ... $ prepost : Factor w/ 2 levels "post","pre": 2 2 2 2 2 2 2 2 2 2 ... library(latt

[R] legend problem

2010-04-22 Thread Nilza BARROS
Dear R users, I have been plotting several graphics in only one page. I intend to plot only one legend in each page. Since the graphics are inside a loop I have to do it automatically. The main problem is that inside the loop I work with differente types of variables, I mean , the range is differe

Re: [R] How to insert gridlines in lattice density plot

2010-04-22 Thread Bert Gunter
" Must one compose a panel function?" Depending on what you want exactly, no. Add the argument type="g" to your call. (e.g. densityplot(~fallrates, groups = prepost,type="g",... ) See ?panel.xyplot and recall that lattice passes down arguments that it does not know what to do with to the p

Re: [R] using which to select range of values

2010-04-22 Thread Greg Snow
Another solution (whether this is better/worse, prettier/uglier, etc./etc. is in the eye of the beholder): library(TeachingDemos) x0 <- rnorm(100) x0[ 0 %<% x0 %<% 1.5 ] Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.40

Re: [R] How to insert gridlines in lattice density plot

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 4:52 PM, Bert Gunter wrote: " Must one compose a panel function?" Depending on what you want exactly, no. Add the argument type="g" to your call. (e.g. densityplot(~fallrates, groups = prepost,type="g",... ) See ?panel.xyplot and recall that lattice passes down argum

[R] How to insert gridlines in lattice density plot

2010-04-22 Thread Giles
Thank you Burt Gunter and David Winsemius, I confirmed David's comment. One must use type=c("p","g") in order to get both the grid and points. So, to use densityplot well, we must be quite aware of the options for panel.xyplot! Cordially, Giles Crane

Re: [R] overlaying a levelplot on a map plot

2010-04-22 Thread Felix Andrews
You don't have to use map() to draw the map. m <- map(..., plot = FALSE) xyplot(y ~ x, m, type = "l", aspect = "iso", par.settings = list(axis.line = list(col = "transparent"))) or inside a panel function, assuming appropriate scales: panel.xyplot(m$x, m$y, ...) On 23 April 2010 04:38, David

[R] ROC curve in randomSurvivalForest

2010-04-22 Thread Nick Fankhauser
I'm using randomSurvivalForest to predict survival from a rather small sample. As it's not enough data to have training and validation set, I rely on the "Estimate of error rate" computed by the randomForest. If I understand the method correctly, it repeatedly partitions the data into varying t

[R] Why does 'apply(.., 1, .., ..)' transpose result

2010-04-22 Thread Worik R
I am sorry if this is documented in apply's dcumentation or completely obvious, I could not find or work it out. Given an matricies Q: 2x3, R:1x3 and S:1x2 apply(Q, 1, '-', R) is 3x2 and apply(Q, 2, '-', S) is 2x3 Why? cheers Worik > Q [,1] [,2] [,3] [1,]123 [2,] 10 11 1

Re: [R] simple question

2010-04-22 Thread Carl Witthoft
Or use this handy-dandy function: smode<-function(x){ xtab<-table(x) modes<-xtab[max(xtab)==xtab] mag<-as.numeric(modes[1]) #in case mult. modes, this is safer themodes<-names(modes) mout<-list(themodes=themodes,modeval=mag) return(mout) }

Re: [R] how to reorder of groups and specify ylim for each row in lattice barchart

2010-04-22 Thread Peter Ehlers
On 2010-04-21 21:13, zhenjiang xu wrote: R experts, Is there anyway to reorder inside each group? In the following example, the bar of year 1932 is always plotted before the bar of year 1931, may I change the order inside each groups of bars? Do you mean a different order in different panels?

[R] cell-based high-throughput chemical compound screens package?

2010-04-22 Thread Zoppoli, Gabriele (NIH/NCI) [G]
Hi I'm looking for a package to perform quality control, normalization and analysis of high throughput cell-based chemical screens. I know that the cellHTS2 package provides this for siRNA screens. Does anybody know if something like what I'm looking for exists? Thank you! Gabriele Zoppoli,

Re: [R] overlaying a levelplot on a map plot

2010-04-22 Thread Felix Andrews
You are plotting the entire lattice plot (including axes, margins etc) in the grid viewport. What you want to do is to call the panel function, panel.levelplot(), instead. However, why not just mm <- map('worldHires', plot = FALSE) levelplot(z~x+y,xyz, mm = mm, panel = function(..., mm) { pan

[R] Practical work with logistic regression

2010-04-22 Thread Claus O'Rourke
Dear all, I have a couple of short noob questions for whoever can take them. I'm from a very non-stats background so sorry for offending anybody with stupid questions ! :-) I have been using logistic regression care of glm to analyse a binary dependent variable against a couple of independent var

Re: [R] problem of R CMD check

2010-04-22 Thread rusers.sh
Hi , This maybe a bug. I checked my another package, the same problem occurred. See below for detailed information. ##check log## * using log directory 'D:/StatSoft/R/MyPackage/sbar.Rcheck' * using R version 2.10.1 (2009-12-14) * using session charset: ISO8859-1 * checking for file 'sbar/DESCRIPT

[R] Remove duplicated rows

2010-04-22 Thread chrisli1223
Hi all, I have a dataset similar to the following NameDateValue A 1/01/2000 4 A 2/01/2000 4 A 3/01/2000 5 A 4/01/2000 4 A 5/01/2000 1 B 6/01/2000 2 B 7/01/2000 1 B 8/01/2000 1 I would like R

Re: [R] User inputs

2010-04-22 Thread chrisli1223
Thank you very much Dieter and Don. This solves my problem. :) -- View this message in context: http://r.789695.n4.nabble.com/User-inputs-tp2018251p2023067.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing l

Re: [R] Practical work with logistic regression

2010-04-22 Thread Gabor Grothendieck
confusionMatrix in the caret package can be used to replace your manual procedure. You could try using RWeka, the R interface to the java Weka software. Once you have it working you could then directly interface your java program to Weka without involving R. On Thu, Apr 22, 2010 at 9:29 PM, Claus

Re: [R] time difference

2010-04-22 Thread Carol Gao
thank you! this really helps! On Thu, Apr 22, 2010 at 7:00 PM, jim holtman wrote: > ?strptime > > Read the documentation and you will find reference to "%OSn" > > > x <- strptime('13:45:34.123', format="%H:%M:%OS") > > x > [1] "2010-04-22 13:45:34" > > format(x, format="%H:%M:%OS3") > [1] "13:45

[R] packages gdata / gtools - installation in R 2.11.0

2010-04-22 Thread Paulo Barata
Dear R-list members, I have just downloaded R version 2.11.0. Then I installed package gdata. At the end of the installation, a warning message said that package gtools could not be found. Package gdata was, after the installation, included in the "Package Index" in the help files. Messages duri

Re: [R] Practical work with logistic regression

2010-04-22 Thread Frank E Harrell Jr
Claus O'Rourke wrote: Dear all, I have a couple of short noob questions for whoever can take them. I'm from a very non-stats background so sorry for offending anybody with stupid questions ! :-) I have been using logistic regression care of glm to analyse a binary dependent variable against a c

[R] help with plotting lines linking two sets of points?

2010-04-22 Thread Kristiina Hurme
Hello everyone, I'm trying to plot the initial and final size of some tadpoles and look at their growth rates (slope of line). They are divided into 6 densities, and so far I have plotted the initial and final sizes (these are means for a pool), and color coded for the 6 densities, but I want a l

[R] Problem with parsing a dataset - help earnestly sought

2010-04-22 Thread Min-Han Tan
Dear fellow R-help members, I hope to seek your advice on how to parse/manage a dataset with hundreds of columns. Two examples of these columns, 'cancer.problems', and 'neuro.problems' are depicted below. Essentially, I need to parse this into a useful dataset, and unfortunately, I am not familiar

  1   2   >