Re: [R] Transform variable number of rows per subject to column variables?

2005-09-20 Thread Kevin Bartz
Hey Bing, Reshape's the ticker -- ?reshape. For example, reshape(myFrame, idvar = ID, timevar = TEST.A) should do most of the trick. Kevin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bing Ho Sent: Monday, September 19, 2005 10:04 PM To:

Re: [R] [handling] Missing [values in randomForest]

2005-09-12 Thread Kevin Bartz
Hi Jan-Paul, You definitely want to be careful with na.omit in randomForest -- that wipes out any row with even one NA. If NAs are sprawled throughout your dataset, na.omit might end up killing a lot of rows. Here's my usual MO for missing values: 1) impute in Hmisc fills in gaps with the mean,

Re: [R] error with scan

2005-07-26 Thread Kevin Bartz
Can you show us the first line of the file? The error means that in one of the values you specified as numeric (first, second, third, fourth, fifth, seventh, eighth, ninth), it found the character value it displayed. Otherwise, this looks like a good use of scan. Kevin -Original

Re: [R] vectorization

2005-06-17 Thread Kevin Bartz
These two lines worked for me: rst - tapply(mydata$income, mydata$education, median) mydata$md - rst[mydata$education] Here's my cheesy example: mydata - data.frame(income= round(rnorm(3, 55000, 1)), + education = letters[rbinom(3, 4, 1/2)+1]) rst -

Re: [R] apply for nested lists

2005-01-26 Thread Kevin Bartz
Actually, what you want is sapply. sapply(tst.list, [[, VAL) Kevin Alexandre Sanchez Pla wrote: Hi, I am working with lists whose terms are lists whose terms are lists. Although the real ones contain locuslink identifiers and GO annotations (I work with the Bioconductor GO) package, I have

Re: [R] How to save a complete image of the current state of R ?

2004-10-22 Thread Kevin Bartz
Andreas Buness wrote: Hello, I like to save the complete state of R, i.e. including all environments, objects/workspaces, loaded packages etc.. This wish has arisen since I am not able to reproduce an error which occurs when running R CMD check. Many thanks for your advice in advance. Best Regards

Re: [R] A question in R

2004-10-12 Thread Kevin Bartz
Yayira har wrote: I started to learn the R language, but I didn't suceed to use an external file. Let say that I have an excel file called test1.xls in the directory C:/program files/R/rw2000/external_files that looks like that: name mark yair 80 yosi 70 ... In the

Re: [R] R 2.0.0 is not suffisantly reliable to be used

2004-10-10 Thread Kevin Bartz
Fan wrote: WHAT CAN I DO FOR YOU, SIR ? Perhaps you're expecting some sort of congratulations for that new release ? I've taken time to download it, test it, and I've said what I've got to say. You're helping nobody with that sort of process of intention. -- Fan Liaw, Andy wrote: From: Fan After

Re: [R] Reading multiple files into R

2004-10-01 Thread Kevin Bartz
Roger Bivand wrote: On Fri, 1 Oct 2004, Vikas Rawal wrote: I want to read data from a number of files into R. Reading individual files one by one requires writing enormous amount of code that will look something like the following. maptools:::dbf.read(wb-01vc.dbf)-dist1

Re: [R] pointsize in png graphics

2004-09-30 Thread Kevin Bartz
[EMAIL PROTECTED] wrote: Dear all, I'm trying to produce 2 png files, one consisting of an image plot and a color-table (also an image plot) and the other one consisting of 4 image plots and a color table. I'd like the color table to be exactly the same. The way I proceded is the following: for

Re: [R] Re: read dbf files into R

2004-09-28 Thread Kevin Bartz
Vikas Rawal wrote: Is there a linux-based/free command line tool for converting dbf files into txt? Conceptually, it is not a great way of doing things. We have a dbf file with a well defined structure. We convert it into a text file, which has a loose structure, undefined variables types etc.

RE: [R] do.call([, ...) question

2004-09-08 Thread Kevin Bartz
This worked very well for me: do.call([, c(list(a), jj)) What about you? Kevin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robin Hankin Sent: Wednesday, September 08, 2004 7:08 AM To: [EMAIL PROTECTED] Subject: [R] do.call([, ...) question Hi

RE: [R] gridBase and heatmap

2004-09-07 Thread Kevin Bartz
The problem is that most base plotting functions first wipe the graphics device clean. To do what you want, you need to use par(new = T) liberally between plots. Does that work for you? Kevin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sean Davis

RE: [R] using hist() with tapply()

2004-09-01 Thread Kevin Bartz
Hi Paul, I think lattice's histogram will do what you want, and in a friendlier manner. Take a look at this example: require(lattice) a - data.frame(draw = as.vector(mapply(rnorm, rep(100, 4), rep(0, 4), 1:4)), sd = factor(paste(sd =, rep(1:4, each = 100 Go ahead and

RE: [R] Help using Hmisc / Latex

2004-08-25 Thread Kevin Bartz
I'm afraid you need to modify your approach. You're trying to pass latex an lm object, which latex doesn't know how to handle. Also, latex isn't supposed to produce a full .tex file; it generates just a core that's loaded into a shell when you run dvi. Here's an example of how you might use it

RE: [R] extract a row

2004-08-16 Thread Kevin Bartz
The easiest way to do that is subset(dataframe, rate == slow). Please let me know if you have any more questions. Kevin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Randy Zelick Sent: Monday, August 16, 2004 10:49 AM To: R list server posting

[R] DESCRIPTION.in

2004-07-27 Thread Kevin Bartz
Hello R world! I'm building a bundle of four packages, but I don't always want to build the whole bundle. Usually I just want to tweak one function in one of the packages and rebuild just that package. As such, I have DESCRIPTION and DESCRIPTION.in files sitting in all the package folders.

RE: [R] GHK simulator

2004-07-15 Thread Kevin Bartz
Yes. See the mvtnorm package on CRAN. It implements Genz's algorithm, the fastest method in town. (I have a version I converted to S-PLUS as well, if you, or anyone, might need it.) Kevin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Trenkler, Dietrich

[R] RODBC repeated rows problem

2004-07-14 Thread Kevin Bartz
Hello everyone! I'm having the dreaded repeated rows problem in RODBC. Specifically, when I have a NULL value in a column, odbcFetchRows reads the value not as NULL or NA but as the most recent non-NULL value in the column. If there is no such non-NULL column, odbcFetchRows reads the value as 0.

[R] Seg. faults in mapthin

2004-07-01 Thread Kevin Bartz
Hi everyone! I know segmentation faults are awfully hard to diagnose, but I'm experiencing a fairly regular pattern of seg. faults when plotting using map in the maps package. Starting R fresh, I run: require(maps) for (i in 1:50) { cat(i, \n) map(state) } I always get the same result: 1 2

RE: [R] Seg. faults in mapthin (in package maps!)

2004-07-01 Thread Kevin Bartz
Dr. Ripley, you are the master. That fix worked like a charm! All the way to 50, with no problems. Thanks again, Kevin -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Thursday, July 01, 2004 10:07 AM To: Kevin Bartz Cc: [EMAIL PROTECTED] Subject: Re: [R] Seg

RE: [R] removing NA from an its object

2004-06-29 Thread kevin bartz
What did you try with apply? It seems to work for me. I did x2[!apply(is.na(x2), 1, any),] and got the desired results. Kevin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Laura Holt Sent: Tuesday, June 29, 2004 9:26 AM To: [EMAIL PROTECTED] Subject:

RE: [R] abline and its objects

2004-06-29 Thread Kevin Bartz
The problem is that you've instructed R to place lines at the values 91.55, 99.39, 97.04, 92.37 and 88.02, but these values do not correspond to the user coordinates of the x-axis (which you've specified to be dates). Luckily, the dates where you need lines are in the rownames of zi. You do need

[R] text length in grid

2004-06-28 Thread kevin bartz
Hello! I first would like to compliment the authors of grid on what has been a wonderfully useful package for me. Now, my question: Is there any way I can specify the size of some grid.text using grid units? I must label the regions of a plot. The regions can be either very small or very large,

RE: [R] question about latex command in Hmisc

2004-06-21 Thread kevin bartz
When you do latex from the command line (Run - cmd), what does DOS say? Maybe latex isn't in your PATH. Kevin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Laura Holt Sent: Monday, June 21, 2004 9:59 AM To: [EMAIL PROTECTED] Subject: [R] question about

[R] Readline on R-1.9.1a

2004-06-14 Thread Kevin Bartz
match the return type of a gcc2 |builtin and then its argument prototype would still apply. */ | char rl_callback_read_char (); | int | main () | { | rl_callback_read_char (); | ; | return 0; | } configure:21338: result: no Any ideas? Thanks for any help you can provide. Kevin

RE: [R] Readline on R-1.9.1a

2004-06-14 Thread Kevin Bartz
To: Liaw, Andy Cc: 'Roger D. Peng'; 'Peter Dalgaard'; Kevin Bartz; [EMAIL PROTECTED] Subject: Re: [R] Readline on R-1.9.1a Liaw, Andy [EMAIL PROTECTED] writes: From: Roger D. Peng People who compile from source still need to install the necessary rpms. Sure, but apparently one can