Re: [R] is there a way to let R do smart matrix-vector operation?

2006-03-07 Thread Robin Hankin
One can always use the often-overlooked sweep(): a - matrix(2:7,2,3) b - matrix(1:2,2,1) sweep(a,1,b) [,1] [,2] [,3] [1,]135 [2,]135 best rksh On 6 Mar 2006, at 23:10, Michael wrote: Hi all, I want to substract vector B from A's each column... how

Re: [R] returning the largest element in an array/matrix?

2006-03-07 Thread Petr Pikal
Hi If you do not insist on which.max() you can use which(mat==max(mat), arr.ind=T) HTH Petr On 6 Mar 2006 at 20:55, Michael wrote: Date sent: Mon, 6 Mar 2006 20:55:20 -0800 From: Michael [EMAIL PROTECTED] To: R-help@stat.math.ethz.ch

Re: [R] collocation methods

2006-03-07 Thread Martin Maechler
Alex == Alexander Nervedi [EMAIL PROTECTED] on Mon, 06 Mar 2006 17:31:40 + writes: Alex Hi All, I have found the function poly(), that Alex computes orthogonal polynomials. I was wondering if Alex there are users of this function on the list. What Alex kind of an

Re: [R] is there a way to let R do smart matrix-vector operation

2006-03-07 Thread Ted Harding
On 06-Mar-06 Michael wrote: Hi all, I want to substract vector B from A's each column... how can R do that smartly without a loop? A=matrix(c(2:7), 2, 3) A [,1] [,2] [,3] [1,]246 [2,]357 B=matrix(c(1, 2), 2, 1) B [,1] [1,]1 [2,]2 A-B

[R] disable lazy-loading in install.packages() ?

2006-03-07 Thread Ulrich Leopold
R.version _ platform i486-pc-linux-gnu arch i486 os linux-gnu system i486, linux-gnu status major2 minor1.1 year 2005 month06 day 20 language R Dear list, how can I disable lazy-loading in 'install.packages(some packages)'? I know of the possiblity to

[R] postscriptFonts

2006-03-07 Thread Roland Kaiser
Hi, I have problems creating a new mapping for a postscript font. I want to use the font-family TheSans from Luc(as) de Groot. The font only holds a .PFM file but no .afm file. The. PFM looks similary to those in grDevices\afm When i use postcriptFont(), i get an error! ivalid font metric

Re: [R] postscriptFonts

2006-03-07 Thread Prof Brian Ripley
Well, yes, you do need an afm file, as it says. On Tue, 7 Mar 2006, Roland Kaiser wrote: Hi, I have problems creating a new mapping for a postscript font. I want to use the font-family TheSans from Luc(as) de Groot. The font only holds a .PFM file but no .afm file. The. PFM looks similary to

Re: [R] disable lazy-loading in install.packages() ?

2006-03-07 Thread Prof Brian Ripley
Why do you want to? As from a near-future version of R, you will not be able to do this via R CMD INSTALL. The recommended place to specify this is in the packages' DESCRIPTION files, and why do you think you know better than the packages' authors? (Quite a few packages will not work with it

[R] Three level linear mixed models

2006-03-07 Thread Pryseley Assam
Hello R-users Is it possible to fit a three level linear mixed effect model in R? If anyone has an idea or sample code, i will appreciate it very much if i can receive it. I am reading the book by Pinheiro and Bates but have not come across that yet! Kind regards

[R] RODBC fail install

2006-03-07 Thread R Gott
I'm a newcomer - obvioulsly I fear. Tried to install RODBC from CRAN mirror onto mahcine 64bit running suse10. terminal log below - it failed on ODBC headers sql.h and sqlext.h not found di i need anothe rpackage?? can someone help please? ta v much Prof R Gott Durham UNiv, UK

Re: [R] Three level linear mixed models

2006-03-07 Thread Andrew Robinson
Hm ..., at the risk of seeming facetious, can I suggest three.layers - lme(response ~ predictors, random = ~ 1 | one / two / three, data = very.large.dataset) ?? Cheers Andrew On Tue, Mar 07, 2006 at 01:35:19AM -0800, Pryseley Assam wrote: Hello

Re: [R] How to solve lazy-loading faiolure for pkg gstat - was (disable lazy-loading in install.packages() ?)

2006-03-07 Thread Ulrich Leopold
Because I get the follwoing message: --- ** R ** data ** demo ** inst ** preparing package for lazy loading Error in loadNamespace(i, c(lib.loc, .libPaths()), keep.source) : there is no package called 'sp' Execution halted ERROR: lazy

Re: [R] How to solve lazy-loading faiolure for pkg gstat - was (disable lazy-loading in install.packages() ?)

2006-03-07 Thread Uwe Ligges
Ulrich Leopold wrote: Because I get the follwoing message: --- ** R ** data ** demo ** inst ** preparing package for lazy loading Error in loadNamespace(i, c(lib.loc, .libPaths()), keep.source) : there is no package called

Re: [R] How to solve lazy-loading faiolure for pkg gstat - was (disable lazy-loading in install.packages() ?)

2006-03-07 Thread Prof Brian Ripley
Use install.packages(dependencies=TRUE). It won't load if you disable lazy-loading, so that was not a solution. On Tue, 7 Mar 2006, Ulrich Leopold wrote: Because I get the follwoing message: --- ** R ** data ** demo ** inst **

[R] Boxplot Help Needed

2006-03-07 Thread Sumanta Basak
Hi R-Experts, How can I show all the relevant measures like mean, median, min. value, max. value, outlier in a single boxplot diagram? Suppose I have a data set c(2,4,5,7,12,14,15,13,8,5,23,98,11) Sumanta Basak. [[alternative HTML version deleted]]

Re: [R] RODBC fail install

2006-03-07 Thread Uwe Ligges
R Gott wrote: I'm a newcomer - obvioulsly I fear. Tried to install RODBC from CRAN mirror onto mahcine 64bit running suse10. terminal log below - it failed on ODBC headers sql.h and sqlext.h not found di i need anothe rpackage?? can someone help please? The root directory of that

Re: [R] How to solve lazy-loading faiolure for pkg gstat - was (disable lazy-loading in install.packages() ?)

2006-03-07 Thread Roger Bivand
On Tue, 7 Mar 2006, Prof Brian Ripley wrote: Use install.packages(dependencies=TRUE). It won't load if you disable lazy-loading, so that was not a solution. Is this perhaps what happens when a package introduces a dependency between revisions, so update.packages() is not going to notice a

Re: [R] RODBC fail install

2006-03-07 Thread Prof Brian Ripley
On Tue, 7 Mar 2006, R Gott wrote: I'm a newcomer - obvioulsly I fear. Tried to install RODBC from CRAN mirror onto mahcine 64bit running suse10. Well, we need to know more than that: see the posting guide for how to report your platform. It may matter which 64-bit platform. terminal log

Re: [R] How to solve lazy-loading faiolure for pkg gstat - was (disable lazy-loading in install.packages() ?)

2006-03-07 Thread Prof Brian Ripley
On Tue, 7 Mar 2006, Roger Bivand wrote: On Tue, 7 Mar 2006, Prof Brian Ripley wrote: Use install.packages(dependencies=TRUE). It won't load if you disable lazy-loading, so that was not a solution. Is this perhaps what happens when a package introduces a dependency between revisions, so

[R] font plotMeans

2006-03-07 Thread teresa boca
Hello, I want to create a plot whit plotMeans. How can I change the font? Thanks in advance. Teresa Boca __ [[alternative HTML version deleted]] __

Re: [R] Boxplot Help Needed

2006-03-07 Thread michael watson \(IAH-C\)
You can always use points() mat - matrix(rnorm(360),nrow=10) boxplot(mat~col(mat)) means - apply(mat,2, mean) points(1:36,means,pch=X,col=red) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sumanta Basak Sent: 07 March 2006 09:55 To:

Re: [R] Boxplot Help Needed

2006-03-07 Thread Uwe Ligges
Sumanta Basak wrote: Hi R-Experts, How can I show all the relevant measures like mean, median, min. value, max. value, outlier in a single boxplot diagram? Suppose I have a data set c(2,4,5,7,12,14,15,13,8,5,23,98,11) Your e-mail address suggests this is not a homework

Re: [R] Boxplot Help Needed

2006-03-07 Thread Dimitris Rizopoulos
you mean that you want something like: x - c(2,4,5,7,12,14,15,13,8,5,23,98,11) sx - summary(x) boxplot(x) text(x = 1 - 0.3, y = seq(40, 70, length = 6), paste(names(sx), : , sx, sep = )) I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of

[R] [R-pkgs] New package 'portfolio'

2006-03-07 Thread Jeff Enos
We would like to announce the availability of the 'portfolio' package in R for analysing equity portfolios. Version 0.2-0 is now available on CRAN. To take a look, you can: install.packages(portfolio) ... vignette(portfolio) and play around. Those who would just like to check out an

[R] Constrained linear least squares

2006-03-07 Thread Domenico Vistocco
Is there a function in R for constrained linear least squares? I used the matlab function LSQLIN: my aim is to obtain non-negative regression coefficients which sum 1. Thanks in advance, domenico vistocco ___ Yahoo! Mail:

[R] Building tkentry dynamicly

2006-03-07 Thread a . menicacci
Dear R-users, I would like to build N tkentry compounds in the same window, with default text for each. As N is variable I need to construct them in an iterative way : library(tcltk) main-tktoplevel() tktitle(main)-My Tool filenames-c(toto,tata,titi) N-length(filenames) for (i in 1: N)

[R] (newbie) Accessing the pieces of a 'by' object

2006-03-07 Thread Vivek Satsangi
Folks, I know that I can do the following using a loop. That's been a lot easier for me to write and understand. But I am trying to force myself to use more vectorized / matrixed code so that eventually I will become a better R programmer. I have a dataframe that has some values by Year, Quarter

[R] POSIX time zone codes

2006-03-07 Thread Jason Horn
The manual entry for as.POSIX says this about time zone codes... Usage as.POSIXct(x, tz = ) tz A timezone specification to be used for the conversion... but it fails to mention what these specifications are. So far, I have tried... as.POSIX(x, tz=UTC) ... works, gives UTC times

Re: [R] (newbie) Accessing the pieces of a 'by' object

2006-03-07 Thread Gabor Grothendieck
Try this: iris.by - do.call(rbind, by(iris[,-5], iris[,5,drop=FALSE],colSums)) do.call(rbind, iris.by) On 3/7/06, Vivek Satsangi [EMAIL PROTECTED] wrote: Folks, I know that I can do the following using a loop. That's been a lot easier for me to write and understand. But I am trying to force

Re: [R] Building tkentry dynamicly

2006-03-07 Thread Peter Dalgaard
[EMAIL PROTECTED] writes: Dear R-users, I would like to build N tkentry compounds in the same window, with default text for each. As N is variable I need to construct them in an iterative way : library(tcltk) main-tktoplevel() tktitle(main)-My Tool filenames-c(toto,tata,titi)

Re: [R] POSIX time zone codes

2006-03-07 Thread Jason Horn
Whoops, [EDIT] as.POSIX(x, tz=UTC) ... works, gives UTC times as.POSIX(x, tz=EST) ... works, gives EST times as.POSIX(x, tz=CST) ... does NOT work, gives UTC times [/EDIT] On Mar 7, 2006, at 8:05 AM, Jason Horn wrote: as.POSIX(x, tz=UTC) ... works, gives UTC times as.POSIX(x, tz=UTC)

Re: [R] (newbie) Accessing the pieces of a 'by' object

2006-03-07 Thread Gabor Grothendieck
Sorry, that should be: iris.by - by(iris[,-5], iris[,5,drop=FALSE],colSums) do.call(rbind, iris.by) On 3/7/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: Try this: iris.by - do.call(rbind, by(iris[,-5], iris[,5,drop=FALSE],colSums)) do.call(rbind, iris.by) On 3/7/06, Vivek Satsangi [EMAIL

Re: [R] Building tkentry dynamicly

2006-03-07 Thread John Fox
Dear Alexandre, It is possible to do what you want. Take a look, for example, at the dialog box produced by Statistics - Contingency tables - Enter and analyze two-way table in the Rcmdr package. That dialog box is able to modify itself and to keep variables for an arbitrary number of tkentry()

Re: [R] Interleaving elements of two vectors?

2006-03-07 Thread bogdan romocea
For a general solution without warnings try interleave - function(v1,v2) { ord1 - 2*(1:length(v1))-1 ord2 - 2*(1:length(v2)) c(v1,v2)[order(c(ord1,ord2))] } interleave(rep(1,5),rep(3,8)) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gabor

[R] lme and gls : accessing values from correlation structure and variance functions

2006-03-07 Thread Pryseley Assam
Dear R-users I am relatively new to R, i hope my many novice questions are welcome. I have problems accessing some objects (specifically the random effects, correlation structure and variance function) from an object of class gls and lme. I used the following models:

Re: [R] Building tkentry dynamicly

2006-03-07 Thread Sean Davis
On 3/7/06 8:29, John Fox [EMAIL PROTECTED] wrote: Dear Alexandre, It is possible to do what you want. Take a look, for example, at the dialog box produced by Statistics - Contingency tables - Enter and analyze two-way table in the Rcmdr package. That dialog box is able to modify itself

Re: [R] returning the largest element in an array/matrix?

2006-03-07 Thread Henrik Bengtsson
This is a problem how to convert vector indices to array indices. Here is a general solution utilizing the fact that matrices are stored column by column in R (this extends to arrays of any dimension): arrayIndex - function(i, dim) { ndim - length(dim); # number of dimension v -

Re: [R] POSIX time zone codes

2006-03-07 Thread Gabor Grothendieck
Only and GMT are really guaranteed to work on all systems since the time zones are system dependent but try: CDT6CST and see if that works on your system. On 3/7/06, Jason Horn [EMAIL PROTECTED] wrote: Whoops, [EDIT] as.POSIX(x, tz=UTC) ... works, gives UTC times as.POSIX(x, tz=EST) ...

Re: [R] Building tkentry dynamicly

2006-03-07 Thread John Fox
Dear Sean, That was Peter Dalgaard's suggestion, posted a little while ago. It's a much better solution to Alexandre's problem than what I suggested. I'm not sure that it would work for the Rcmdr dialog that I mentioned, but I'll take a look when I have a chance. Regards, John

[R] breslow estimator for cumulative hazard function

2006-03-07 Thread singyee ling
Dear R-users, I am checking the proportional hazard assumption of a cox model for a given covariate, let say Z1, after adjusting for other relavent covariates in the model. To this end, I fitted cox model stratified on the discrete values of Z1 and try to get beslow estimator for the baseline

Re: [R] POSIX time zone codes

2006-03-07 Thread Jason Horn
Thank you again Gabor, that did the trick. Any thoughts on where I go go for a reference for these time codes? Where did you get CDT6CST from? Or is this just one of those things that is common knowledge in UNIX circles. To the R developers: I recommend a sentence be added to the manual

Re: [R] breslow estimator for cumulative hazard function

2006-03-07 Thread Christos Hatzis
The function 'basehaz' computes the predicted survivor function for a Cox prop hazards model centered (at the average values of the covariates) or non-centered (at zero level of covariates). As far as the estimator used, basehaz defaults to the Nelson-Aalen estimate of the cumulative hazard with

Re: [R] POSIX time zone codes

2006-03-07 Thread Gabor Grothendieck
Each OS would presumably have to document it. I personally use Windows and in that case there is some info here: http://msdn2.microsoft.com/en-us/library/90s5c885.aspx On 3/7/06, Jason Horn [EMAIL PROTECTED] wrote: Thank you again Gabor, that did the trick. Any thoughts on where I go go for a

Re: [R] (newbie) Accessing the pieces of a 'by' object

2006-03-07 Thread Vivek Satsangi
I am writing to document the answer for the next poor sod who comes along. To get tmp_byRet() into a multi-dimentional matrix, copy the object using as.vector(), then copy the dim and dimnames from tmp_byRet into the new object. However, this may not be what you want, since you probably want the

Re: [R] (newbie) Accessing the pieces of a 'by' object

2006-03-07 Thread Gabor Grothendieck
Another solution (ex #3) is to return a data frame with at least two columns and then remove the dummy one using drop = FALSE: # ex #1. error iris.by - by(iris, iris[,5, drop = FALSE], length) do.call(rbind, iris.by) # ex #2. ok but no column heading iris.by - by(iris, iris[,5, drop=FALSE],

[R] How to change time zones?

2006-03-07 Thread Jason Horn
Say you have a POSIX object that is in UTC. How do you change the values to another timezone? If I do this: times - strptime(times, %H:%M:%S) times1 - as.POSIXct(times, tz=UTC) times2 - as.POSIXct(times, tz=CDT6CST) times1 id UTC, but times2 is still UTC, not CTD. Why? Is the only was to

Re: [R] How to change time zones?

2006-03-07 Thread Gabor Grothendieck
POSIX objects are UTC internally but can be displayed with respect to other time zones. By the way, do you really need time zones in the first place? Read R News 4/1 help desk article which will help you determine which date/time class is suitable for your application and also has a table of

[R] coding problems

2006-03-07 Thread \(s\) Richard Nuttall
hi, I am trying to fit an ARIMA model to some time series data, I have used differencing to make the data stationary. dailyibm is the data I am using, could someone please help out in identifying the coding as I can't seem to identify the problem many thanks fit.ma - arima.sim(dailyibm -

Re: [R] QCA adn Fuzzy

2006-03-07 Thread Adrian DUSA
Dear Prof. Gott, On Monday 06 March 2006 14:37, R Gott wrote: Does anybody know of aything that will help me do Quantitiative Comparative Analysis (QCA) and/or Fuzzy set analysis?? Or failing that Quine? ta rg Prof R Gott Durham Univesrity UK There is a package called QCA which (in its

[R] Regarding categorization or grouping of data

2006-03-07 Thread Andrew Athan
Could someone please provide a examples regarding best practice for grouping and/or categorization of data? E.g., if I have a data page with columns X,CAT where CAT is an integer 1-10, and I want to create a new data page where for each value of CAT I have the sum(X)? E.g., I have same

Re: [R] Regarding categorization or grouping of data

2006-03-07 Thread Sean Davis
On 3/7/06 2:20 PM, Andrew Athan [EMAIL PROTECTED] wrote: Could someone please provide a examples regarding best practice for grouping and/or categorization of data? E.g., if I have a data page with columns X,CAT where CAT is an integer 1-10, and I want to create a new data page where

[R] glm automation

2006-03-07 Thread A Mani
Hello, I have two problems in automating multiple glm(s) operations. The data file is tab delimited file with headers and two columns. like ABC EFG 1 2 2 3 3 4 dat - read.table(FILENAME, header=TRUE, sep=\t, na.strings=NA, dec=., strip.white=TRUE) dataf - read.table(FILENAME,

Re: [R] returning the largest element in an array/matrix?

2006-03-07 Thread Michael
I think this is the best solution! Thank you! On 3/7/06, Petr Pikal [EMAIL PROTECTED] wrote: Hi If you do not insist on which.max() you can use which(mat==max(mat), arr.ind=T) HTH Petr On 6 Mar 2006 at 20:55, Michael wrote: Date sent: Mon, 6 Mar 2006 20:55:20 -0800

Re: [R] returning the largest element in an array/matrix?

2006-03-07 Thread Gabor Grothendieck
I agree that that is the best solution although not to the question as stated which said: I want to use which.max On 3/7/06, Michael [EMAIL PROTECTED] wrote: I think this is the best solution! Thank you! On 3/7/06, Petr Pikal [EMAIL PROTECTED] wrote: Hi If you do not insist on

[R] Making an S3 object act like a data.frame

2006-03-07 Thread hadley wickham
[.ggobiDataset - function(x, ..., drop=FALSE) { x - as.data.frame(x) NextMethod([, x) } [[.ggobiDataset - function(x, ..., drop=FALSE) { x - as.data.frame(x) NextMethod([[, x) } $.ggobiDataset - function(x, ..., drop=FALSE) { x - as.data.frame(x)

Re: [R] Making an S3 object act like a data.frame

2006-03-07 Thread Gabor Grothendieck
If your class is a subclass of data.frame then I think it ought to be a special sort of data frame so all you need to do is the following in which case you get subscripting for free by inheritance: # constructor myobj - function(...) structure(data.frame(...), class = c(myobj,

[R] reading in only one column from text file

2006-03-07 Thread mark salsburg
How do I manipulate the read.table function to read in only the 2nd column??? [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide!

[R] how to use the rpart function?

2006-03-07 Thread Michael
Hi all, What parameter do I normally change in the rpart function? How do I set the cp option? Is there a way to read off error rate directly from the rpart function for training data; I imagine for testing data I have to apply a predict, but for training data I guess the error count would

Re: [R] Making an S3 object act like a data.frame

2006-03-07 Thread hadley wickham
If your class is a subclass of data.frame then I think it ought to be a special sort of data frame so all you need to do is the following in which case you get subscripting for free by inheritance: My class is actually an external pointer to a data set stored in ggobi, so I don't think this

Re: [R] reading in only one column from text file

2006-03-07 Thread Seth Falcon
mark salsburg [EMAIL PROTECTED] writes: How do I manipulate the read.table function to read in only the 2nd column??? If your data is small, you can read in all columns and then subset the resulting data frame. Try that first. Perhaps there is a nicer way to do this that I don't know about,

Re: [R] reading in only one column from text file

2006-03-07 Thread Peter Dalgaard
mark salsburg [EMAIL PROTECTED] writes: How do I manipulate the read.table function to read in only the 2nd column??? Something along the lines of cc - rep(NULL, ncols) cc[2] - NA # use type.convert read.table( colClasses=cc ) -- O__ Peter Dalgaard Ă˜ster

Re: [R] reading in only one column from text file

2006-03-07 Thread Kjetil Brinchmann Halvorsen
mark salsburg wrote: How do I manipulate the read.table function to read in only the 2nd column??? Se the colClasses argument of read.table() Kjetil [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list

Re: [R] reading in only one column from text file

2006-03-07 Thread Berton Gunter
You are not reading the Help file correctly. It says: Character.A vector of classes to be assumed for the columns. Recycled as necessary. colClasses=NULL) means that you have no colClasses argument. It does exactly what you tell it to (use whatever defaults it has, inother

Re: [R] reading in only one column from text file

2006-03-07 Thread Liaw, Andy
read.table(datafile, colClasses=c(NULL, numeric), ...) or something like that. Andy From: mark salsburg How do I manipulate the read.table function to read in only the 2nd column??? [[alternative HTML version deleted]] __

[R] Writing out complex text file

2006-03-07 Thread Sean Davis
I have a group of data.frames that I need to write out interspersed with some complex header information at the top of each. The file needs include many such data.frame/header pairs. Is it as simple as using a connection and printing to it everything (including tabs and endlines, etc.), or is

Re: [R] reading in only one column from text file

2006-03-07 Thread Jean Eid
You might want to read ?scan and pay attention to what= argument Jean mark salsburg wrote: How do I manipulate the read.table function to read in only the 2nd column??? [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing

Re: [R] glm automation

2006-03-07 Thread Jean Eid
If you know what the dependent variable is called and is the same for all regressions see ?formula Or you can do glm(ABC~. , ...,data=dat) PS. the way you are calling the formula you are taking the first element in the first column and the first element in the second column. So that is not

Re: [R] Making an S3 object act like a data.frame

2006-03-07 Thread Henrik Bengtsson
Hi. On 3/7/06, hadley wickham [EMAIL PROTECTED] wrote: [.ggobiDataset - function(x, ..., drop=FALSE) { x - as.data.frame(x) NextMethod([, x) } [[.ggobiDataset - function(x, ..., drop=FALSE) { x - as.data.frame(x) NextMethod([[, x) } $.ggobiDataset -

Re: [R] Making an S3 object act like a data.frame

2006-03-07 Thread hadley wickham
x$total_bill Error in $.default(x, total_bill) : invalid subscript type where/how is $.default() defined? I don't have one; getAnywhere($.default) no object named '$.default' was found Neither do I. I guess there is some internal magic going on for $. Hadley

Re: [R] Making an S3 object act like a data.frame

2006-03-07 Thread Gabor Grothendieck
Just to get something reproducible lets assume the objects of class myobj each consists of a one-element list that contains a data frame. Then try this: # constructor myobj - function(...) structure(list(value = data.frame(...)), class = myobj) $.myobj - function(obj, x) .subset2(obj,

Re: [R] Writing out complex text file

2006-03-07 Thread Sean Davis
On 3/7/06 5:10 PM, Sean Davis [EMAIL PROTECTED] wrote: I have a group of data.frames that I need to write out interspersed with some complex header information at the top of each. The file needs include many such data.frame/header pairs. Is it as simple as using a connection and printing

Re: [R] Making an S3 object act like a data.frame

2006-03-07 Thread hadley wickham
Just to get something reproducible lets assume the objects of class myobj each consists of a one-element list that contains a data frame. Then try this: Thanks for that - it makes sense. Every time I try to use inheritance in R, I always seem to end up using a different method. Hadley

Re: [R] Making an S3 object act like a data.frame

2006-03-07 Thread Gabor Grothendieck
On 3/7/06, hadley wickham [EMAIL PROTECTED] wrote: Just to get something reproducible lets assume the objects of class myobj each consists of a one-element list that contains a data frame. Then try this: Thanks for that - it makes sense. Every time I try to use inheritance in R, I

Re: [R] Making an S3 object act like a data.frame

2006-03-07 Thread hadley wickham
I tend to have to use trial and error myself. Here is another possibility. That's got the subsetting solved, so here's the next challenge lm(x ~ y, z) Error in as.data.frame.default(data) : cannot coerce class myobj into a data.frame as.data.frame.myobj - function(x) x[[1]] lm(x ~ y, z)

[R] how to use the randomForest and rpart function?

2006-03-07 Thread Michael
Hi all, I am trying to play around with the randomForest function for classification. I know its performance is great. I am currently using the default options. It has many options. How do I further tweak the options so that I can make its performance even better? What are the options that

Re: [R] how to use the randomForest and rpart function?

2006-03-07 Thread Michael
When I plot the randomForest object, it shows a graph with 3 lines, green, red and black, what's the meaning of these three lines? On 3/7/06, Michael [EMAIL PROTECTED] wrote: Hi all, I am trying to play around with the randomForest function for classification. I know its performance is

Re: [R] Making an S3 object act like a data.frame

2006-03-07 Thread Gabor Grothendieck
The problem is that x[[1]] in the definition of as.data.frame.myobj invokes [[.myobj whereas we want to extract the first element of the list in the internal representation of x -- which is not the same. Try this instead: as.data.frame.myobj - function(x) .subset2(x, 1) lm(y ~ x, z) Call:

Re: [R] how to use the randomForest and rpart function?

2006-03-07 Thread Liaw, Andy
As ?plot.randomForest says, it plots error rates. In addition to overall error rates, it also plots error rates for each class. As to the options in randomForest, read about the options in the help page and the reference linked from the help page. Andy From: Michael When I plot the

Re: [R] glm automation

2006-03-07 Thread ronggui
2006/3/8, A Mani [EMAIL PROTECTED]: Hello, I have two problems in automating multiple glm(s) operations. The data file is tab delimited file with headers and two columns. like ABC EFG 1 2 2 3 3 4 dat - read.table(FILENAME, header=TRUE, sep=\t, na.strings=NA, dec=.,

Re: [R] how to use the randomForest and rpart function?

2006-03-07 Thread Michael
It did not have a legend showing on which color is for class1, which color is for class2, etc... I've read the R-help page. It lists a lot of options, but it did not say which ones are the key parameters that people use most for improving performance... Do you know? On 3/7/06, Liaw, Andy

Re: [R] glm automation

2006-03-07 Thread Liaw, Andy
From: ronggui 2006/3/8, A Mani [EMAIL PROTECTED]: Hello, I have two problems in automating multiple glm(s) operations. The data file is tab delimited file with headers and two columns. like ABC EFG 1 2 2 3 3 4 dat - read.table(FILENAME, header=TRUE, sep=\t,

Re: [R] how to use the randomForest and rpart function?

2006-03-07 Thread Liaw, Andy
Yes, I do know. That's why I pointed you to the reference linked from the help page. BTW, there's also an R News article describing the initial version of the package. Have you perused that? Andy -Original Message- From: Michael [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 07,

[R] problem installing RNetCDF

2006-03-07 Thread Zepu Zhang
Hello all, I set 'UDUNITS_PATH' and 'NETCDF_PATH' successfully to my custom places and then % R CMD INSTALL RNetCDF_1.1-3.tar.gz and got this: ... checking for executable suffix... checking for object suffix... o checking whether we are using the GNU C compiler... yes checking whether gcc

[R] Degrees of freedom using Box.test()

2006-03-07 Thread Nestor Arguea
After an RSiteSeach(Box.test) I found some discussion regarding the degrees of freedom in the computation of the Ljung-Box test using Box.test(), but did not find any posting about the proper degrees of freedom. Box.test() uses lag=number as the degrees of freedom. However, I believe the