[R] error in dat

2008-06-15 Thread Paul Adams
Hello everyone, I have the following code which keeps giving me an error. The code is: dat<-read.table(file="C:\\Documents and Settings\\Owner\\My Documents\\eisen.txt",header=T,row.names=1,blank.lines.skip=F,na..strings="NA") dimnames(dat)((1)) <-as.character(dat(,1)) dat<-dat(,-1) dat<-as.data.f

[R] Display a jpeg inside a widget which already has text

2008-06-15 Thread danzam
Hi I am trying to insert a jpeg into a widget I have created. I have used this link http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/showImage.html to display a jpeg inside a newly created widget but would like some info on how to insert into a pre existing widget. This is my code below fo

Re: [R] package under unix

2008-06-15 Thread Prof Brian Ripley
If you want a new device opened you can call dev.new() In current R. X11() does have xpos and ypos, *but* there is no guarantee that any value you choose will not be the same as the default. Indeed, with windows(5,5,xpos=0) you will put your second window on top of the first one in my setup.

[R] Superimposing Line over Histogram in Density Plot

2008-06-15 Thread Gundala Viswanath
Hi, Currently I have a density plot generated with this snippet. Is there a way I can add a line curve on top of it? I mean in one figure __BEGIN__ myhist <- hist(x col="blue", main = "Density Plot", xlab = "Exp Level", ) __END__ - Gundal

Re: [R] simulating Gaussian Mixture Method

2008-06-15 Thread Bill.Venables
Adding them together will not give you a sample from a mixture, it gives you a sample from another multivariate normal distribution. Rather than add them together what you have to do is select from each of the two samples with the appropriate probability. e.g. suppose your mixing probability wa

Re: [R] simulating Gaussian Mixture Method

2008-06-15 Thread Moshe Olshansky
You should not add the 3 six dimensional variables!!! By adding them you are getting a multivariate normal variable and not a mixture! To get a mixture with probabilities p1 for the first, p2 for the second and p3 for the third one (p1+p2+p3=1), simulate a [0,1] uniform variable X and return th

[R] simulating Gaussian Mixture Method

2008-06-15 Thread Peng Jiang
Hi, I have a mixture pdf which has three components, each satisfies the 6 dimension normal distribution. I use mvrnorm() from the MASS library to generate 1000 samples for each component and I add them to get the random samples which satisfies with the mixture distribution. I us

[R] package tm, error with VectorSource

2008-06-15 Thread Kieren Diment
Hi, the documentation for tm advertises the following: > docs <- c("This is a text.", "This another one.") > Corpus(VectorSource(docs)) but this doesn't work for me: > docs <- c("This is a text.", "This another one.") > Corpus(VectorSource(docs)) Corpus(VectorSource(docs)) Error: could not fi

Re: [R] Help finding the mode and maximum for a specified 'window' of time series data

2008-06-15 Thread Moshe Olshansky
Another possibility is to create a matrix m <- matrix(sample[,2],nrow=4) and then use apply to compute maximum and mode for every column. --- On Mon, 16/6/08, jim holtman <[EMAIL PROTECTED]> wrote: > From: jim holtman <[EMAIL PROTECTED]> > Subject: Re: [R] Help finding the mode and maximum for

Re: [R] Creating a Hash from Data.Frame

2008-06-15 Thread hadley wickham
On Sun, Jun 15, 2008 at 9:03 PM, jim holtman <[EMAIL PROTECTED]> wrote: > here is a way: > >> x <- read.table(textConnection("#GDS_ID GENE_NAME GENE_DESCRIPTION >> GENE_FUNCTION > + 1007_s_at | DDR1 | discoidin domain receptor tyrosine kinase 1 | > protein-coding > + 1053_at | RFC2 | replication f

Re: [R] Delete Block of Rows

2008-06-15 Thread Moshe Olshansky
I believe that x <- x[-(1:25),] should work. --- On Sun, 15/6/08, nmarti <[EMAIL PROTECTED]> wrote: > From: nmarti <[EMAIL PROTECTED]> > Subject: [R] Delete Block of Rows > To: r-help@r-project.org > Received: Sunday, 15 June, 2008, 11:02 PM > I am trying to delete a section of rows from a data

Re: [R] candisc() error message

2008-06-15 Thread John Fox
Dear Tanya, If I follow correctly what you're trying to do, you're in effect doing a one-way MANOVA of 17 response variables on a six-level factor, with only 20 observations. That's not enough data. I'm copying to Michael Friendly in case he hasn't seen your posting and would like to comment. Reg

Re: [R] Creating a Hash from Data.Frame

2008-06-15 Thread Martin Morgan
"Gundala Viswanath" <[EMAIL PROTECTED]> writes: > Hi, > > I have the following data frame: > >> print(mydatframe) > > __DATAFRAME__ > >V1V2 V3 > 1 1007_s_at DDR1 discoidin domain receptor tyrosine kinase 1 > 2 1053_at RFC2 replication factor C (activator 1) 2, 40kDa > 3 117_at HSPA6

Re: [R] Creating a Hash from Data.Frame

2008-06-15 Thread Gundala Viswanath
Thanks so much Jim, I owe you a million! - Gundala Viswanath Jakarta - Indonesia On Mon, Jun 16, 2008 at 11:03 AM, jim holtman <[EMAIL PROTECTED]> wrote: > here is a way: > >> x <- read.table(textConnection("#GDS_ID GENE_NAME GENE_DESCRIPTION >> GENE_FUNCTION > + 1007_s_at | DDR1 | discoidin do

Re: [R] Creating a Hash from Data.Frame

2008-06-15 Thread jim holtman
here is a way: > x <- read.table(textConnection("#GDS_ID GENE_NAME GENE_DESCRIPTION > GENE_FUNCTION + 1007_s_at | DDR1 | discoidin domain receptor tyrosine kinase 1 | protein-coding + 1053_at | RFC2 | replication factor C (activator 1) 2, 40kDa | protein-coding + 117_at | HSPA6 | heat shock 70kDa

[R] Creating a Hash from Data.Frame

2008-06-15 Thread Gundala Viswanath
Hi, I have the following data frame: > print(mydatframe) __DATAFRAME__ V1V2 V3 1 1007_s_at DDR1 discoidin domain receptor tyrosine kinase 1 2 1053_at RFC2 replication factor C (activator 1) 2, 40kDa 3 117_at HSPA6 heat shock 70kDa protein 6 (HSP70B') __END__ Is there a way to cre

Re: [R] randomForest, 'No forest component...' error while calling Predict()

2008-06-15 Thread Moshe Olshansky
You must use randomForest with keep.forest=TRUE - otherwise the Forest object is not saved and so no prediction can be made. --- On Mon, 16/6/08, Jim_S <[EMAIL PROTECTED]> wrote: > From: Jim_S <[EMAIL PROTECTED]> > Subject: [R] randomForest, 'No forest component...' error while calling > Pred

Re: [R] Separator with " | " for read.table

2008-06-15 Thread jim holtman
I am not exactly sure what you are after, but if you are just printing out a single column, then unless you use "drop=FALSE" in referencing it, it is a vector: > x <- read.table(textConnection("#GDS_ID GENE_NAME GENE_DESCRIPTION > GENE_FUNCTION + 1007_s_at | DDR1 | discoidin domain receptor tyros

Re: [R] Separator with " | " for read.table

2008-06-15 Thread Gundala Viswanath
Thanks so much Jim, It works. However how come the "\n" was not removed. Meaning when I do: print (x$V3) it gives something like this: __OUTPUT__ [1] discoidin domain receptor tyrosine kinase 1 [2] replication factor C (activator 1) 2, 40kDa [3] heat shock 70kDa protein 6 (HSP70

Re: [R] Separator with " | " for read.table

2008-06-15 Thread jim holtman
Does this give you what you want: > x <- read.table(textConnection("#GDS_ID GENE_NAME GENE_DESCRIPTION > GENE_FUNCTION + 1007_s_at | DDR1 | discoidin domain receptor tyrosine kinase 1 | protein-coding + 1053_at | RFC2 | replication factor C (activator 1) 2, 40kDa | protein-coding + 117_at | HSPA6

[R] Separator with " | " for read.table

2008-06-15 Thread Gundala Viswanath
Hi, I have the following data file to be parsed and captured as a data frame: __DATA__ #GDS_ID GENE_NAME GENE_DESCRIPTION GENE_FUNCTION 1007_s_at | DDR1 | discoidin domain receptor tyrosine kinase 1 | protein-coding 1053_at | RFC2 | replication factor C (activator 1) 2, 40kDa | protein-coding 117

Re: [R] Specifying fonts in R

2008-06-15 Thread Duncan Murdoch
On 15/06/2008 8:45 PM, Tariq Perwez wrote: Hi I am a novice user of R. I got hold of "R Graphics" by P. Murrell the other day and am trying to follow examples in the book. In chapter 3, the section on font specification gives 16 "basic" font families and face combinations available in R (Figure 3

[R] Specifying fonts in R

2008-06-15 Thread Tariq Perwez
Hi I am a novice user of R. I got hold of "R Graphics" by P. Murrell the other day and am trying to follow examples in the book. In chapter 3, the section on font specification gives 16 "basic" font families and face combinations available in R (Figure 3.9). However, the book also warns that even i

[R] candisc() error message

2008-06-15 Thread Tanya Yatsunenko
Hi, I am doing canonical discriminant analysis using candisc function from the candisc package. My input is a table of species distribution (columns = abundance of each species in each sample) in samples that are split by categories (rows), and I want to know whether each category is associated

Re: [R] R as chart engine in web-service

2008-06-15 Thread jim holtman
Can you put some criteria on 'better'/'faster'. What throughput are you expecting? How many requests per second will you have to handle? What is the timing of your current method? What size/type machine will you be running on? Is data being accessed from a database which may influence the timin

[R] R vs SAS and HLM on multilevel analysis- basic question

2008-06-15 Thread eugen pircalabelu
Hi R users! I am trying to learn some multilevel analysis, but unfortunately i am now very confused. The reason: http://www.ats.ucla.edu/stat/hlm/seminars/hlm_mlm/mlm_hlm_seminar.htm http://www.ats.ucla.edu/stat/sas/seminars/sas_mlm/mlm_sas_seminar.htm and MlmSoftRev. pdf from mlmRev package.

Re: [R] package under unix

2008-06-15 Thread Christophe Genolini
Generally, I like to use a pdf device which can have any number of pages. I am proposing a graphical way a selecting a clusterization based a quality criterion. In order to avoid local maximum, you can build something like 10 000 clusterization. Exporting all of them has no sence. So I open t

[R] R as chart engine in web-service

2008-06-15 Thread Daniel Cegielka
Hi R-users I think about some web service with stock charts and I plan use python as web framework with R as mathematical and chart engine. I use rpy to connect R with python. It works good. Is it good idea to use R as chart engine? Maybe it's better (faster) to use c/c++ plugin? Daniel __

[R] randomForest, 'No forest component...' error while calling Predict()

2008-06-15 Thread Jim_S
Dear R-users, While making a prediction using the randomForest function (package randomForest) I'm getting the following error message: "Error in predict.randomForest(model, newdata = CV) : No forest component in the object" Here's my complete code. For reproducing this task, please find my 2

Re: [R] package under unix

2008-06-15 Thread Patrick Connolly
On Fri, 13-Jun-2008 at 04:51PM +0200, [EMAIL PROTECTED] wrote: > Hi the list, > > I write a package for clusterizing longitudinal data using a non parametric > algorithm. I develop the package under windows. To be as user friendly as > possible, the package use some graphical procedure to "show"

Re: [R] changing the police of my graph's title

2008-06-15 Thread Stephen Weigand
On Sun, Jun 15, 2008 at 8:15 AM, hanen <[EMAIL PROTECTED]> wrote: > hi; > > i want to change the police of the title of my graph.i tried to use > font.title and cex.title but there was no changing in characters fount. > > is there any one who could help me? > -- Try 'font.main' and 'cex.main'. Th

Re: [R] restricted coefficient and factor in linear regression.

2008-06-15 Thread Paul Johnson
On Sat, Jun 14, 2008 at 7:49 AM, Oh Dong-hyun <[EMAIL PROTECTED]> wrote: > Hi, > > my data set is data.frame(id, yr, y, l, e, k). > > I would like to estimate Lee and Schmidts (1993, OUP) model in R. > > My colleague wrote SAS code as follows: > ** procedures for creating dummy variables are omitte

Re: [R] multilevel basic lme question

2008-06-15 Thread Dieter Menne
eugen pircalabelu yahoo.com> writes: > I want to use the lme package for a multilevel analysis on the following example: > > math<-c(2, 3,2, 5, 6 ,7 , 7) > > sex<-c(1, 2, 1, 2, 2, 2, 1) > > school_A<-c(1,1,1,2,2,2,2) > > school_B<-c(10,10,10,20,20,20,20) > > mydata<-data.frame(math, sex, school_

Re: [R] How to take the average of multiple rows

2008-06-15 Thread Marc Schwartz
on 06/15/2008 01:18 PM ss wrote: Dear all, I have a matrix, called newdata1, dim(newdata1) [1] 3417683 It looks like: EntrezIDName S1 S2 S3S4 S5. 1 4076 CAPRIN1 0.1 0.2 0.3... 2 139170WDR40B 0.4 0.5 0.6... 3

[R] How to take the average of multiple rows

2008-06-15 Thread ss
Dear all, I have a matrix, called newdata1, > dim(newdata1) [1] 3417683 It looks like: EntrezIDName S1 S2 S3S4 S5. 1 4076 CAPRIN1 0.1 0.2 0.3... 2 139170WDR40B 0.4 0.5 0.6... 35505PPP1R2P1 0.3 0.3 0.7

[R] multilevel basic lme question

2008-06-15 Thread eugen pircalabelu
Hi R users I want to use the lme package for a multilevel analysis on the following example: > math<-c(2, 3,2, 5, 6 ,7 , 7) > sex<-c(1, 2, 1, 2, 2, 2, 1) > school_A<-c(1,1,1,2,2,2,2) > school_B<-c(10,10,10,20,20,20,20) > mydata<-data.frame(math, sex, school_A, school_B) > mydata School_A and sc

Re: [R] How to make this binary hit matrix

2008-06-15 Thread ssls sddd
Thank you very much, Marc! Have a great weekend! Alex On Sun, Jun 15, 2008 at 1:58 PM, Marc Schwartz <[EMAIL PROTECTED]> wrote: > on 06/15/2008 12:46 PM ssls sddd wrote: > >> Hi all, >> >> Basically I want to make a binary hit matrix. >> >> For instance, if I have a file called 'pair.txt': >> >

Re: [R] Help finding the mode and maximum for a specified 'window' of time series data

2008-06-15 Thread jim holtman
This will give you an idea of how you might want to approach the problem: > sample <-cbind((1:20)*.25,c(1,1,1,2,2,3,3,3,4,5,6,4,4,3,3,3,2,1,1,1)) > sample [,1] [,2] [1,] 0.251 [2,] 0.501 [3,] 0.751 [4,] 1.002 [5,] 1.252 [6,] 1.503 [7,] 1.753 [8,] 2.003

Re: [R] How to make this binary hit matrix

2008-06-15 Thread Marc Schwartz
on 06/15/2008 12:46 PM ssls sddd wrote: Hi all, Basically I want to make a binary hit matrix. For instance, if I have a file called 'pair.txt': set_agene_1 set_agene_2 set_agene_3 set_bgene_3 set_bgene_4 set_bgene_5 set_cgene_1 set_cgene_3 And I want to convert

[R] How to make this binary hit matrix

2008-06-15 Thread ssls sddd
Hi all, Basically I want to make a binary hit matrix. For instance, if I have a file called 'pair.txt': set_agene_1 set_agene_2 set_agene_3 set_bgene_3 set_bgene_4 set_bgene_5 set_cgene_1 set_cgene_3 And I want to convert it to a binary matrix as: Rowsset_a

[R] How to make this binary hit matrix

2008-06-15 Thread ssls sddd
Hi all, Basically I want to make a binary hit matrix. For instance, if I have a file called 'pair.txt': set_agene_1 set_agene_2 set_agene_3 set_bgene_3 set_bgene_4 set_bgene_5 set_cgene_1 set_cgene_3 And I want to convert it to a binary matrix as: Rowsset_a

Re: [R] recursive beta with cutoffs on large data set

2008-06-15 Thread Dirk Eddelbuettel
Ivo, On 15 June 2008 at 12:50, ivo welch wrote: | dear R experts: I have an academic question that borders on asking | for consulting help, so I hope I am not too imposing. If I am, please | ignore me. | | My data set has 100MB data set of daily stock returns. I want to | compute rolling (rec

[R] Working with LiDAR .las files

2008-06-15 Thread Etienne Bellemare Racine
Hi, I am working with airborne LiDAR data and R. Do you know of any package or project designed to achieve that goal ? Largely, if you are using R and .las files (or lidar data), I would like to hear about your work flow. Otherwise, if you know of a package that can help handling x,y,z data (i

[R] recursive beta with cutoffs on large data set

2008-06-15 Thread ivo welch
dear R experts: I have an academic question that borders on asking for consulting help, so I hope I am not too imposing. If I am, please ignore me. My data set has 100MB data set of daily stock returns. I want to compute rolling (recursive?) betas---either bivariate or multivariate---with respe

Re: [R] Weights and coxph

2008-06-15 Thread Thomas Lumley
It turns out that the issue is ties in survival times. Repeating the data produces tied failure times; weighting does not, so you get different results. The effect is unusually large here, perhaps because of the small sample size. If you use the (less accurate) Breslow correction for ties, yo

[R] Help finding the mode and maximum for a specified 'window' of time series data

2008-06-15 Thread Staples, Angela Dawn
I am relatively new to R, so apologize up front for my long question, particularly if there is too much or too little information. I have a large time series data set where each subject's behavior was originally coded on .25s intervals for 3min task. I am trying to determine if the findings are di

Re: [R] Maximum likelihood estimation in R with censored Data

2008-06-15 Thread Thomas Lumley
Try survreg(), in the survival package. -thomas On Fri, 13 Jun 2008, Bluder Olivia wrote: Hello, I'm trying to calculate the Maximum likelihood estimators for a dataset which contains censored data. I started by using the function "nlm", but isn't there a separate method for doing

Re: [R] cch function and time dependent covariates

2008-06-15 Thread Thomas Lumley
cch() does not allow for multiple records per person (as it says), and so doesn't allow for time-dependent covariates. -thomas On Thu, 12 Jun 2008, Jin Wang wrote: same subject id has to be multiple in mutiple times like following format, Multiple records per id not allowed in cch() so

Re: [R] Delete Block of Rows

2008-06-15 Thread Wacek Kusnierczyk
nmarti wrote: > I am trying to delete a section of rows from a data frame (based on no > condition). Lets say my data frame has 200 rows and I want to delete rows 1 > through 25. How would I do this? > > I know x[ -1, ] deletes the first row (or any desired row). I tried using > different variat

Re: [R] Delete Block of Rows

2008-06-15 Thread milton ruser
Hi there, I don´t know if you are trying to solve the delete job or to test how functions work. If you really want to delete lines from a data.frame, try something like this. rowcount<-1:100 x<-runif(100) y<-runif(100) df<-data.frame(cbind(rowcount,x,y)) df.subset<-subset(df, !(rownames(df) %

[R] changing the police of my graph's title

2008-06-15 Thread hanen
hi; i want to change the police of the title of my graph.i tried to use font.title and cex.title but there was no changing in characters fount. is there any one who could help me? -- View this message in context: http://www.nabble.com/changing-the-police-of-my-graph%27s-title-tp17849886p178498

[R] Delete Block of Rows

2008-06-15 Thread nmarti
I am trying to delete a section of rows from a data frame (based on no condition). Lets say my data frame has 200 rows and I want to delete rows 1 through 25. How would I do this? I know x[ -1, ] deletes the first row (or any desired row). I tried using different variations of this, like x[ -c

Re: [R] cbind'ing multivariate ts objects

2008-06-15 Thread Gabor Grothendieck
Try the zoo package: > library(zoo) > as.ts(cbind(as.zoo(t1), as.zoo(t2))) Time Series: Start = 1 End = 11 Frequency = 1 a b c d 1 10 20 30 40 2 11 21 31 41 3 12 22 32 42 4 13 23 33 43 5 14 24 34 44 6 15 25 35 45 7 16 26 36 46 8 17 27 37 47 9 18 28 38 48 10 19 29 39 49 11 20 30 40

Re: [R] round(1.5) = round(2.5) = 2?

2008-06-15 Thread Toby Marthews
Hi Markus, The R function round() uses the round-to-even method, which is explained on http://en.wikipedia.org/wiki/Rounding#Round-to-even_method. If you would like instead "traditional rounding" then you should add 0.5 and take the integer part, as is suggested in the examples on ?round, e.g. x

[R] round(1.5) = round(2.5) = 2?

2008-06-15 Thread Markus Didion
Dear R-users with a bit of grief I had to repeat an extensive analysis because I did not suspect (and therefore did not read the documentation) that round was implemented as "for rounding off a 5, the IEC 60559 standard is expected to be used, 'go to the even digit'", resulting in round(1.5)

Re: [R] cbind'ing multivariate ts objects

2008-06-15 Thread Андрей Парамонов
2008/6/15 jim holtman <[EMAIL PROTECTED]>: > Is this what you want: > >> t <- ts(data.frame(a = 10:20, b = 20:30, c = 30:40, d = 40:50)) >> t1 <- t[, c('a', 'b')] >> t2 <- t[, c('c', 'd')] >> >> colnames(t1) > [1] "a" "b" >> >> colnames(t2) > [1] "c" "d" >> >> x <- cbind(t1, t2) >> colnames(x) > [1

Re: [R] cbind'ing multivariate ts objects

2008-06-15 Thread Андрей Парамонов
2008/6/15 Prof Brian Ripley <[EMAIL PROTECTED]>: > Consistent with what? This is how all such combinations of matrices in R > work, and avoids duplicate names. > Hm, for data.frames and matrices it works like this: > d <- data.frame('a' = 10:20, b = 20:30, c = 30:40, d = 40:50) > d1 <- d[c('a',

Re: [R] cbind'ing multivariate ts objects

2008-06-15 Thread Prof Brian Ripley
On Sat, 14 Jun 2008, Андрей Парамонов wrote: I use R 2.7.0 on GNU/Linux. I have noticed a problem in cbind method for multivariate time series (ts) objects. Consider the following example: t <- ts(data.frame(a = 10:20, b = 20:30, c = 30:40, d = 40:50)) t1 <- t[, c('a', 'b')] t2 <- t[, c('c', '