Re: [R] tcltk package

2005-07-07 Thread Liaw, Andy
It's included in the base R distribution, I believe. Andy From: Kurt Sys Hi all, I have a package depending on the tcltk-package. However, I see that this package has been disappeared... Is there a reason why package 'tcltk' is not available anymore? Or is it replaced by another one?

Re: [R] randomForest

2005-07-07 Thread Liaw, Andy
, Liaw, Andy [EMAIL PROTECTED] wrote: The limitation comes from the way categorical splits are represented in the code: For a categorical variable with k categories, the split is represented by k binary digits: 0=right, 1=left. So it takes k bits to store each split on k categories

Re: [R] randomForest

2005-07-07 Thread Liaw, Andy
0 0 4 0 0 3 5 0 0 5 1 0 3 0 8 0 6 0 0 0 3 0 5 and class number returned from sample.size is like: 28, 8, 82, 28, 18, 22 Should I use gbm to try it since it might focus more on misplaced cases? thanks, weiwei On 7/7/05, Liaw, Andy [EMAIL

[R] It was a sad day for the Statistics profession

2005-07-08 Thread Liaw, Andy
For those of you who have not heard: Prof. Breiman passed away on July 5th. http://www.berkeley.edu/news/media/releases/2005/07/07_breiman.shtml Andy __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] package loading smooth.lf (LOCFIT), couldn't find functio n smooth.lf

2005-07-10 Thread Liaw, Andy
The version of locfit on the web site mentioned apparently has been revised by Prof. Loader, and is newer than the CRAN version that I have been maintaining. If Prof. Loader is OK with it, I will take a look and see if I can get the new version into CRAN-conforming form and upload to CRAN.

Re: [R] Off topic -2 Ln Lambda and Chi square

2005-07-11 Thread Liaw, Andy
If you meant the lambda as the likelihood ratio test statistic, the asymptotic chi-squared distribution comes from the asymptotic normality of the MLEs. The proof is in a paper by Abraham Wald in 1943. See Stuart Ord (Kendall's Advanced Statistics) for discussion (e.g., vol. 2, 5th edition).

Re: [R] Weighted nls

2005-07-11 Thread Liaw, Andy
Please do your homework, as the posting guide asks you to. 1. From the Example section of ?nls: ## weighted nonlinear regression Treated - Puromycin[Puromycin$state == treated, ] weighted.MM - function(resp, conc, Vm, K) { ## Purpose: exactly as white book p.451 -- RHS for nls() ##

Re: [R] Projection Pursuit

2005-07-11 Thread Liaw, Andy
Google can be helpful. The 10th hit I got from projection pursuit regression is http://www.scs.gmu.edu/~jgentle/csi991/03f/ppreg1024.rtf, which gives some rough outline of the algorithm. If you want more detail, Ripley (1996) PRNN would suffice, I believe. Andy From: Oliver Lyttelton

Re: [R] vectorizaton

2005-07-12 Thread Liaw, Andy
Try: mymat - rowMeans(P, dims=2) Andy From: Dimitri Joe Hi, I got 1000 NxN matrices grouped in one array. I want one matrix in which p_ij is the average of all the 1000 matrices in the array. Here's what I'm trying to do: # P is the NxNx1000 array for(i in 1:N) for(j in 1:N)

Re: [R] help: how to get the position of a value in a matrix

2005-07-13 Thread Liaw, Andy
Use which(..., arr.ind=TRUE); e.g., m - matrix(runif(12), 3, 4) which(m .8, arr.ind=TRUE) row col [1,] 1 3 [2,] 2 3 [3,] 3 3 [4,] 3 4 m [,1] [,2] [,3] [,4] [1,] 0.2148183 0.08251853 0.9444718 0.4487148 [2,] 0.5386863 0.49673282 0.8054240

Re: [R] How to increase memory for R on Soliars 10 with 16GB and 64bit R

2005-07-14 Thread Liaw, Andy
From: Uwe Ligges Uwe Ligges wrote: Dongseok Choi wrote: Thank you very much for your help!! Now, it runs without any problem. Is it going to be fixed in the next release? Of course, Brian [hmmm, looks like some wrong shortcut has been used - and it must have been

Re: [R] Variance components from lm?

2005-07-14 Thread Liaw, Andy
From: Spencer Graves Under normal circumstances, 'RSiteSearch(variance components)' would likely identify lme in package nlme and lmer in package lme4. I recommend lme, as it comes with a fairly complete set of helper functions described in Pinheiro and Bates (2000)

Re: [R] dataframes of unequal size

2005-07-19 Thread Liaw, Andy
Seems like no one had responded to this one yet, so I'll take a stab: ## Generate some bogus data: set.seed(45) dat - cbind(expand.grid(LETTERS[1:2], 1:3), round(runif(6), 2)) names(dat) - c(state, psu, weight) dat2 - data.frame(state=sample(c(A, B), 100, replace=TRUE),

Re: [R] extracting row means from a list

2005-07-19 Thread Liaw, Andy
Justone more comment in addition to Sundar's solution: If these are all numeric matrices, I would read them into R as such, instead of data frames. Actually, I would read them all into a 3-dimensional array (2000 x 6 x # of files). Assuming you have such an array, then you can do something like:

Re: [R] Chemoinformatic people

2005-07-20 Thread Liaw, Andy
You might want to check out Rajarshi Guha's work on connecting CDK to R. He has an article in the recent issue of CDK News. Andy From: Frédéric Ooms I am more lloking at people working in the field of drug discovery performing clustering analysis, MDS, LDA in order to classify chemicals

Re: [R] writing matrices (no subject)

2005-07-20 Thread Liaw, Andy
Simply gooling for writing ARFF file in R gave the following as first hit, which is right on the WEKA page: Miscellaneous code [...] Function for reading ARFF files into the R statistical package (kindly provided by Dr Craig Struble). Function for writing ARFF files from the R statistical

Re: [R] Code Verification

2005-07-20 Thread Liaw, Andy
From: Christoph Buser Hi t.test assumes that your data within each group has a normal distribution. This is not the case in your example. Eh? What happen to the CLT? Andy I would recommend you a non parametric test like wilcox.test if you want to compare the mean of two samples that

Re: [R] RandomForest question

2005-07-21 Thread Liaw, Andy
-GROW 20-30 TREES, AND SELECT THE VALUE OF MTRY THAT GIVES THE SMALLEST OOB ERROR RATE. mdim is the number of predicators. HTH, weiwei On 7/21/05, Liaw, Andy [EMAIL PROTECTED] wrote: From: [EMAIL PROTECTED] Hello, I'm trying to find out the optimal number of splits (mtry

Re: [R] RandomForest question

2005-07-21 Thread Liaw, Andy
From: [EMAIL PROTECTED] Hello, I'm trying to find out the optimal number of splits (mtry parameter) for a randomForest classification. The classification is binary and there are 32 explanatory variables (mostly factors with each up to 4 levels but also some numeric variables) and

Re: [R] RandomForest question

2005-07-21 Thread Liaw, Andy
From: Uwe Ligges [EMAIL PROTECTED] wrote: Hello, I'm trying to find out the optimal number of splits (mtry parameter) for a randomForest classification. The classification is binary and there are 32 explanatory variables (mostly factors with each up to 4 levels but also some

Re: [R] get the content of object in ls()?

2005-07-27 Thread Liaw, Andy
See ?get. Andy From: Meng Cheng Hi, I am wirting a R script to process some data routinely and have a problem when try to get the content of object in ls()? Here is the script: ls() [1] a b [3] files.num fll92_1a_gpr [5] fll92_1a_gpr_norm fll92_1a.gpr.norm.scale [7] fname

Re: [R] Cochran-Armitage-trend-test

2005-07-28 Thread Liaw, Andy
Simply do RSiteSearch(Armitage) would have given you: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/20396.html Andy From: [EMAIL PROTECTED] Hi! I am searching for the Cochran-Armitage-trend-test. Is it included in an R-package? Thank you! --

Re: [R] interpolation function

2005-08-05 Thread Liaw, Andy
I don't know if what Hao wanted to do is to hang himself, but if so, perhaps here is one possible rope: idx - which(m 0, arr.ind=TRUE) m.nz - m[idx] library(akima) (m.int - interp.new(idx[,1], idx[,2], m.nz, xo=1:9, yo=1:9, extrap=TRUE)) $x [1] 1 2 3 4 5 6 7 8 9 $y [1] 1 2 3 4 5 6 7 8 9 $z

Re: [R] Computing sums of the columns of an array

2005-08-05 Thread Liaw, Andy
See ?colSums. Andy From: Martin C. Martin Hi, I have a 5x731 array A, and I want to compute the sums of the columns. Currently I do: apply(A, 2, sum) But it turns out, this is slow: 70% of my CPU time is spent here, even though there are many complicated steps in my

Re: [R] Statistical significance of a classifier

2005-08-05 Thread Liaw, Andy
From: Martin C. Martin Hi, I have a bunch of data points x from two classes A B, and I'm creating a classifier. So I have a function f(x) which estimates the probability that x is in class A. (I have an equal number of examples of each, so p(class) = 0.5.) One way of

Re: [R] installing problems about randomForest

2005-08-08 Thread Liaw, Andy
From: Prof Brian Ripley On Mon, 8 Aug 2005, Uwe Ligges wrote: Xiao Jianfeng wrote: Hi all, When I tried to install package randomForest, it gave out the following error message: install.packages(randomForest, dependencies = TRUE) trying URL

Re: [R] Saving trellis output to files in scripts...

2005-08-09 Thread Liaw, Andy
This is in the FAQ: You need to wrap any trellis calls in functions or scripts in print(). Andy From: Jamieson Cobleigh With much help from Chuck Cleland, I was able to get xyplot to generate the plot I wanted. I'm trying to write a script (that can be read using source(file)) to create

Re: [R] Finding regions of overlap

2005-08-12 Thread Liaw, Andy
Am I missing something? It seems quite easy to me: Suppose the intervals are (l1, u1), (l2, u2), ..., (ln, un). The intersection, if non-empty, would be (max(l1, ..., ln), min(u1, ..., un)), and the union (min(l1, ..., ln), max(u1, ..., un)). Andy From: Sean Davis I have a number of

Re: [R] Re-sort list of vectors

2005-08-15 Thread Liaw, Andy
If all vectors in the list have the same length, why not use a matrix? Then you'd just transpose the matrix if you need to. If you really have to have it as a list, here's one possibility: x - list(1=c(a=1, b=2, c=3), 2=c(a=4, b=5, c=6)) x $1 a b c 1 2 3 $2 a b c 4 5 6

Re: [R] PCA problem in R

2005-08-15 Thread Liaw, Andy
From: Dennis Shea [SNIP] On Sat, 13 Aug 2005, Alan Zhao wrote: When I have more variables than units, say a 195*10896 matrix which has 10896 variables and 195 samples. prcomp will give only 195 principal components. I checked in the help, but there is no explanation that why this

Re: [R] Re-sort list of vectors

2005-08-15 Thread Liaw, Andy
items. One point could be to build a matrix but this matrix would have many NA's. So I prefer Lists of Lists. Any ideas? cheers Jan -Ursprüngliche Nachricht- Von: Liaw, Andy [mailto:[EMAIL PROTECTED] Gesendet: Montag, 15. August 2005 17:31 An: Jan Hummel; r-help

Re: [R] Anything like dir.choose (similar to file.choose) in R?

2005-08-15 Thread Liaw, Andy
If you can use the `tcltk' package, Prof. John Fox had pointed this out to me before: dir - tclvalue(tkchooseDirectory()) Andy From: Earl F. Glynn Does R have a dir.choose function? I can use file.choose like this as a kludge to get something like a dir.choose, but a real dir.choose

Re: [R] How to get a list work in RData file

2005-08-15 Thread Liaw, Andy
If you want to keep track of the function call that produced an object, usually you need to do that inside the function that's being called, e.g., test.xy - function(x,y) { + xy - x+y + attr(xy, Call) - match.call() + xy + } xyadd - test.xy(x=2, y=3) xyadd [1] 5 attr(,Call)

Re: [R] randomForest Error passing string argument

2005-08-15 Thread Liaw, Andy
If all you need the formula interface for is auto deletion of NAs, I'd suggest doing something like: varlist - c(fruit, apples, oranges, blueberries) fruits.nona - na.omit(fruits.data[varlist]) model.rf - randomForest(fruits.data[-1], fruits.data[[1]], ...) If you want to know the call that

Re: [R] regression with more than one observation per x value

2005-08-16 Thread Liaw, Andy
Sounds like you're looking for something like pure.error.anova in the `alr3' package on CRAN... Andy From: Christoph Scherber Dear R users, How can I do a regression analysis in R where there is more than one observation per x value? I tried the example in SokalRohlf (3rd edn.,

Re: [R] Determining physical display dimensions

2005-08-19 Thread Liaw, Andy
The screen devices are not platform independent, so I guess not. The height and width arguments for windows() is in physical inches, and the ypinch and xpinch specify pixels per inch, according to ?windows. Andy From: Berton Gunter Folks: (Basically a non-R question). Is there any

Re: [R] problem with read.table

2005-08-25 Thread Liaw, Andy
Could it be that there are spaces in the names that were read in? a - data.frame( X=1:2, Y=3:4, Z=5:6, check.names=FALSE) a X Y Z 1 1 3 5 2 2 4 6 names(a) [1] X Y Z a$X NULL Andy From: Krishna Hi Mr. Pedro I tried names(a) and it displayed the names as X, Y and Z.

Re: [R] box m-test

2005-08-25 Thread Liaw, Andy
I posted a translation from a Matlab version a while ago. Search in the list archive. Andy From: Petra Wallem Hello everybody, Is there in R a so called box m-test for testing the equality of the variance/cov. matrix for checking on homoscedasticity? I could not find it among the

Re: [R] xtable

2005-08-30 Thread Liaw, Andy
Have you load the package with library(xtable) before attempting? Andy From: Mag. Ferri Leberl I have installed package xtable with su -c 'R CMD INSTALL xtable' and got this promising feedback: * Installing *source* package 'xtable' ... ** R ** data ** help Building/Updating

Re: [R] problem with certain data sets when using randomForest

2005-08-31 Thread Liaw, Andy
I've been trying to play catch-up on R-help since DSC2005. This one must have slipped through... This is what I'd do: iris.sub - subset(iris, Species %in% c(setosa, virginica)) iris.sub$Species - factor(iris.sub$Species) That last line drops the empty level in the factor. You can then run

Re: [R] Block-Diagonal Matrix and Multivariate Skew Normal

2005-08-31 Thread Liaw, Andy
For your first question, here's a function originally posted by Ben Bolker, with modification by Rich Raubertas: blockdiag - function (x, ...) { if (!is.list(x)) x - list(x) args - list(...) if (length(args) 0) args - c(x, args) else args - x idx -

Re: [R] Re-evaluating the tree in the random forest

2005-09-09 Thread Liaw, Andy
From: Martin Lam Dear mailinglist members, I was wondering if there was a way to re-evaluate the instances of a tree (in the forest) again after I have manually changed a splitpoint (or split variable) of a decision node. Here's an illustration: library(randomForest) forest.rf -

Re: [R] Re-evaluating the tree in the random forest

2005-09-09 Thread Liaw, Andy
have changed. HTH, Andy -Original Message- From: Martin Lam [mailto:[EMAIL PROTECTED] Sent: Friday, September 09, 2005 9:04 AM To: Liaw, Andy; r-help@stat.math.ethz.ch Subject: RE: [R] Re-evaluating the tree in the random forest Hi, Let me give a simple example, assume

Re: [R] usage of the trianed networks by nnet without R enviromen t

2005-09-09 Thread Liaw, Andy
One possibility is to look at predict.nnet(), and - Write an R function that write out parts of an nnet object that are needed by predict.nnet() to an external file. - Re-write predict.nnet() in C, reading the model information from the external file. Obviously you'll also need the C source for

Re: [R] what OS

2005-09-13 Thread Liaw, Andy
From: Sundar Dorai-Raj Omar Lakkis wrote: How can I determine whT OS I am running under? if WINDOWS do this if LINUX do that Hi, Omar, Look at version$os. # windows version$os [1] mingw32 # linux version$os [1] linux-gnu Or see ?.Platform. Andy HTH,

Re: [R] Apply a function for each Row

2005-09-14 Thread Liaw, Andy
From: Barry Rowlingson Marc Bernard wrote: Dear All, I wonder how to apply a given function to each row of a data frame. I've seen this function before but don't remember its name You've just said it twice! 'apply'! A small catch: Marc wants to apply the function to

Re: [R] means comparison in R (post-hoc test)

2005-09-15 Thread Liaw, Andy
Do RSiteSearch(lsmeans) and go from there. Andy From: Felipe -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thank you, I think multcomp is very near to what I was looking for. However, I am still looking for a mean to obtain least-squares (adjusted) means and std. errors of these means,

Re: [R] Neat way of using R for pivoting?

2005-09-20 Thread Liaw, Andy
From: Greg Snow BANNISTER, Keith [EMAIL PROTECTED] 09/20/05 09:46AM Hi, I'd like to use R to do what excel pivot tables do, and plot results. R does not have pivot tables and I hope that it never does. My experiance with pivot tables is that they encourage poor initial

Re: [R] error when loading rwinedt

2005-09-21 Thread Liaw, Andy
You cannot install over a package that is currently loaded. Quit R and restart without loading the RWinEdt package and try again. Andy From: ronggui.wong ronggui.wong wrote: the error msg is: local({pkg - select.list(sort(.packages(all.available = TRUE))) + if(nchar(pkg))

Re: [R] accessing source code in R packages

2005-09-21 Thread Liaw, Andy
R is open source. You can download the source code from CRAN. If you mean at the R prompt, usually you see the code for a function by typing the name of the function at the R prompt, without parentheses. `Usually' because some methods are delibrately `hidden' from users, and should only be

Re: [R] Automatic creation of file names

2005-09-22 Thread Liaw, Andy
From: Leite,Walter Dear R-Help members, I have a question about how to save to the hard drive the one thousand datasets I generated in a simulation. The datasets are created in a for loop that repeatedly creates normally distributed datasets, such as the example below: Library(MASS)

Re: [R] [R-pkgs] Reshape package: new version 0.5

2005-09-23 Thread Liaw, Andy
From: Randall R Schulz Sundar, On Friday 23 September 2005 06:48, Sundar Dorai-Raj wrote: Randall R Schulz wrote: Hadley, ... Perhaps I'm dense, but I cannot find the software at the URL you mention. There are links to a paper and a PDF slide presentation, but no R

Re: [R] confidence variability bands for kernel estimators

2005-09-28 Thread Liaw, Andy
The `sm' package has functionality to produce pointwise band. The `locfit' package can produce simultaneous band. Both are support software for books, where you'll find more detail. Andy From: Michael Gälger I'm using nonparametric regression (packeges ksmooth and ks). My question: is

Re: [R] p-level in packages mgcv and gam

2005-09-28 Thread Liaw, Andy
Just change the df in what Thomas described to the degree of polynomial, and everything he said still applies. Any good book on regression that covers polynomial regression ought to point this out. Andy From: Denis Chabot But what about another analogy, that of polynomials? You may not be

Re: [R] Help ...

2005-10-04 Thread Liaw, Andy
It's because you've asked R to create an object of size 5 * 4 * 12488 * 1000 * 8 bytes, or 1905.5 MB, and R failed to get that much memory from the operating system. Andy From: Gao Fay Hi there, When I run the following, why does it give a error like that?

Re: [R] testing non-linear component in mgcv:gam

2005-10-05 Thread Liaw, Andy
I think you probably should state more clearly the goal of your analysis. In such situation, estimation and hypothesis testing are quite different. The procedure that gives you the `best' estimate is not necessarily the `best' for testing linearity of components. If your goal is

Re: [R] Singular matrix

2005-10-06 Thread Liaw, Andy
Don't you have the dimension of x backward? Try: set.seed(1) x - matrix(rnorm(50, 3, 3), 10, 5) vinv - solve(crossprod(x)) vinv [,1] [,2] [,3] [,4] [,5] [1,] 0.019918251 -0.006247646 0.006600209 0.003687249 -0.018670806 [2,] -0.006247646

Re: [R] boxplot statistics

2005-10-06 Thread Liaw, Andy
From: Graham Williams Received Tue 04 Oct 2005 7:26pm +1000 from Karin Lagesen: I have read and reread the boxplot and the boxplot stats page, and I still cannot understand how and what boxplot shows. I realize that this might be due to me not knowing enough statistics, but anyway...

Re: [R] Simple question.....

2005-10-06 Thread Liaw, Andy
See ?get. Andy From: Fernando Espíndola Hi all user R, My simple question is...I have a vector of names of predictors, text-c(datem,cola,eslom)...I try to plot the model with this predictor in sequence loop, for(i in 1:3){ png(paste(fig_,i,sep=))

Re: [R] Vectorizing loop

2005-10-10 Thread Liaw, Andy
Not unless we know what runifpoint() and Kest() are. AFAIK these are not part of base R. If you use functions from add-on packages, please state them so as not to leave others guessing. (This is in the Posting Guide, which you were asked to read.) Andy From: Rainer M. Krug Hi I have

Re: [R] Vectorizing loop

2005-10-11 Thread Liaw, Andy
From: Rainer M. Krug Sorry runifpoint() and Kest are from the package spatstat Rainer Liaw, Andy wrote: Not unless we know what runifpoint() and Kest() are. AFAIK these are not part of base R. If you use functions from add-on packages, please state them so as not to leave

Re: [R] randomForest question [Broadcast]

2006-07-26 Thread Liaw, Andy
When mtry is equal to total number of features, you just get regular bagging (in the R package -- Breiman Cutler's Fortran code samples variable with replacement, so you can't do bagging with that). There are cases when bagging will do better than random feature selection (i.e., RF), even in

Re: [R] String frequencies in rows

2006-07-26 Thread Liaw, Andy
It's usually faster to operate on columns of data frames, rather than rows, so the following might help: R x G1 G2 G3 G4 1 AA BB AB AB 2 BB AB AB AA 3 AC CC AC AA 4 BB BB BB BB R xt - as.data.frame(t(x)) R sapply(xt, table) $`1` AA AB BB 1 2 1 $`2` AA AB BB 1 2 1 $`3` AA AC CC

Re: [R] memory problems when combining randomForests [Broadcast]

2006-07-26 Thread Liaw, Andy
You need to give us more details, like how you call randomForest, versions of the package and R itself, etc. Also, see if this helps you: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/32918.html Andy From: Eleni Rapsomaniki Dear all, I am trying to train a randomForest using all my

Re: [R] memory problems when combining randomForests

2006-07-27 Thread Liaw, Andy
From: Eleni Rapsomaniki I'm using R (windows) version 2.1.1, randomForest version 4.15. ^ Never seen such a version... I call randomForest like this: my.rf=randomForest(x=train.df[,-response_index],

Re: [R] memory problems when combining randomForests

2006-07-28 Thread Liaw, Andy
From: Eleni Rapsomaniki Hi Andy, I'm using R (windows) version 2.1.1, randomForest version 4.15. ^ Never seen such a version... Ooops! I meant 4.5-15 I then save each tree to a file so I can combine them all

Re: [R] Extracting from a matrix w/o for-loop

2006-07-28 Thread Liaw, Andy
Yes, by matrix indexing: R M1[M2] [1] 1 2 13 15 8 R v [1] 1 2 13 15 8 Andy From: Camarda, Carlo Giovanni Dear R-users, likely there is a simple solution for this problem, but I currently cannot see it. I basically would like to get from a matrix values in particular positions

Re: [R] memory problems when combining randomForests [Broadcast]

2006-07-31 Thread Liaw, Andy
It's the 5th paper on his web page. http://www-stat.stanford.edu/~jhf/ftp/isle.pdf http://www-stat.stanford.edu/~jhf/ftp/isle.pdf Cheers, Andy _ From: Weiwei Shi [mailto:[EMAIL PROTECTED] Sent: Monday, July 31, 2006 11:38 AM To: Eleni Rapsomaniki Cc: Liaw, Andy; r-help

Re: [R] Take random sample from class variable

2006-08-08 Thread Liaw, Andy
There may be better ways, but this should work: R p.yes - 0.7 R n.yes - rbinom(1, nof.sample, p.yes) R n.no - nof.sample - n.yes R dat.yes - mydat[sample(which(mydat$Class == yes), n.yes, replace=TRUE),] R dat.no - mydat[sample(which(mydat$Class == no), n.no, replace=TRUE),] You can rbind()

Re: [R] multinom details

2006-08-08 Thread Liaw, Andy
Try adding trace=FALSE to the call. ?multinom says ... is passed to nnet(), and you'd find trace documented in ?nnet. Please remember to mention the add-on package(s) you're using. Andy From: Bruno L. Giordano Hello, the multinom() procedure prints a lot of information during the

Re: [R] Sampling from a Matrix

2006-08-08 Thread Liaw, Andy
From: Marc Schwartz On Fri, 2006-08-04 at 12:46 -0400, Daniel Gerlanc wrote: Hello all, Consider the following problem: There is a matrix of probabilities: set.seed(1) probs - array(abs(rnorm(25, sd = 0.33)), dim = c(5,5), dimnames = list(1:5, letters[1:5])) probs

Re: [R] Frequency Distribution

2006-08-08 Thread Liaw, Andy
You could just do table(cut(...)) and cumsum(table(cut(...))). See the help pages for those functions. Example: R x - rnorm(1e4) R breaks - c(-Inf, -3:3, Inf) R table(cut(x, breaks)) (-Inf,-3] (-3,-2] (-2,-1](-1,0] (0,1] (1,2] (2,3] (3, Inf] 16 253 1389

Re: [R] boxplot

2006-08-08 Thread Liaw, Andy
When I tried: R x - c(5, rnorm(30)) R boxplot(x) R identify(x) [1] 1 (after I clicked on the obvious outlier, and R labeled it `1') it seems to work just fine. What do you mean by can't apply it boxplot? Andy From: Ana Patricia Martins Hello R-users and developers, Once again,

Re: [R] Multiple density curves

2006-08-10 Thread Liaw, Andy
Assuming dat is the name of the data frame, this should get you started: library(lattice) histogram(~ unlist(dat[-1]) | factor(rep(c(A1, A2), each=nrow(dat))), panel=function(...) { panel.histogram(...) panel.densityplot(...) }, type=density) Andy

Re: [R] basic question re lm() [Broadcast]

2006-08-10 Thread Liaw, Andy
lm(data1) should work just fine. E.g., R data1 - data.frame(v1=rnorm(10), v2=rnorm(10), v3=rnorm(10)) R lm(data1) Call: lm(formula = data1) Coefficients: (Intercept) v2 v3 0.5746 0.3363 -0.5549 Andy From: r user I am using R in a Windows

Re: [R] Box's M test [Broadcast]

2006-08-11 Thread Liaw, Andy
Depends on how you look. Try RSiteSearch(Box's M Test) at the R prompt. Andy From: Wade Wall Hi all, Is there a box's M test for R? I have looked around, but have been unable to find it. Thanks Wade __ R-help@stat.math.ethz.ch mailing

Re: [R] An apply and rep question

2006-08-11 Thread Liaw, Andy
The trick is to rep() the index, not the data: R dat2 - dat[rep(1:nrow(dat), each=2), ] R dat2 DDate OffP 1 2005-01-01 41.23 1.1 2005-01-01 41.23 2 2005-01-02 44.86 2.1 2005-01-02 44.86 3 2005-01-03 44.86 3.1 2005-01-03 44.86 4 2005-01-04 43.01 4.1 2005-01-04 43.01 5

Re: [R] rpvm/snow packages on a cluster with dual-processor machi nes

2006-08-11 Thread Liaw, Andy
Caveat: I've only played with this a couple of years ago... I believe you can just add each host _twice_ (or as many times as the number of CPUs at that host) to get both CPUs to work. Andy From: Paul Y. Peng Hi, does anybody know how to use the dual processors in the machines of a

Re: [R] lasso for variable selection

2006-08-14 Thread Liaw, Andy
For importance it's probably best to stick with absolute values of coefficients, instead of value of the penalty parameter for which the coefficients changed to non-zero. Friedman skipped a lot of details on his rule ensemble in that talk, due to time constraint. In his implementation he was

Re: [R] Auto-save possible in R?

2006-08-14 Thread Liaw, Andy
You could try something like: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/0334.html replacing the time-stamp with save.image() or save(). Not sure how it works in BATCH though... HTH, Andy From: John Morrow Hello fellow R'ers, I have a simple calculation with a very large data set

Re: [R] rpvm/snow packages on a cluster with dual-processor machi nes

2006-08-14 Thread Liaw, Andy
. But I haven't tested it yet. Paul. Ryan Austin wrote: Hi, Adding a node twice gives a duplicate node error. However, adding the parameter sp=2000 to your pvm hostfile should enable dual processors. Ryan Liaw, Andy wrote: Caveat: I've only played

Re: [R] Call for Beta Testers: R+ (read R plus) for Solaris and L inux:

2006-08-14 Thread Liaw, Andy
Note that it's commercially supported, not just commercial. Also, commercial does not mean closed source. Open source (and even GPL) and commercial need not be mutually exclusive. Remember that the free in free software is as in freedom rather than as in beer (as far as GPL is concern, at

Re: [R] Problem with the special argument '...' within a function

2006-08-16 Thread Liaw, Andy
I'm not sure if this is what you want, but simply add ... to the list of arguments for fun1 and fun2 would eliminate the error. Andy From: Hans-Joerg Bibiko Dear all, I wrote some functions using the special argument '...'. OK, it works. But if I call such a function which also called

Re: [R] Autocompletion

2006-08-16 Thread Liaw, Andy
From: Óttar Ísberg Hi! That was quick, and thanks. I'm afraid I wasn't precise enough. I'm using Windows XP and by autocompletion I mean typing the first few letters of a command and then have the system either complete the command or give you possible R under Emacs/ESS has

Re: [R] getting sapply to skip columns with non-numeric data?

2006-08-17 Thread Liaw, Andy
There's something that either you have not thought of or neglected to tell us: If you have k variables in the data frame, you will need a data frame of k variables and one row to be able to rbind() to the bottom of the original one. What are you going to put in place for non-numeric variables?

Re: [R] 4^2 factorial help

2006-08-18 Thread Liaw, Andy
If you really want the quadratic terms, you need to keep those variables as numeric, instead of factors. (You might also want to look into something like the central composite designs.) summary() and coef() on the resulting fitted object should give you want you need. Things like these are

Re: [R] apply least angle regression to generalized linear models

2006-08-18 Thread Liaw, Andy
I believe `lars' does not currently fit glms. For that you'll probably need to look at `glar', at: http://www.insightful.com/Hesterberg/glars/default.asp HTH, Andy From: Marc Schwartz On Fri, 2006-08-18 at 11:17 -0400, Mike Wolfgang wrote: Hello list, I've been searching around

Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread Liaw, Andy
You have at least two choices: R factor(fact[1:6]) [1] A A A B B B Levels: A B R fact[1:6, drop=TRUE] [1] A A A B B B Levels: A B HTH, Andy From: Afshartous, David All, When I take a subset of a factor the reduced factor still maintains all the original levels of the factor when say

[R] how do I tell configure where to find Java?

2006-10-03 Thread Liaw, Andy
Dear R-help, I'm trying to build R-2.4.0 on our Opteron-based Scyld cluster. The system has gcj (the GNU Java compiler, part of GCC) stuff in /usr/bin. When I installed jdk 1.5.08, the install script placed it in /usr/java (I didn't have a choice, as the script didn't offer that option). Now

Re: [R] how do I tell configure where to find Java? [Broadcast]

2006-10-03 Thread Liaw, Andy
- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Liaw, Andy Sent: 03 October 2006 19:40 To: r-help Subject: [R] how do I tell configure where to find Java? Dear R-help, I'm trying to build R-2.4.0 on our Opteron-based Scyld cluster. The system has gcj (the GNU Java

Re: [R] how do I tell configure where to find Java?

2006-10-03 Thread Liaw, Andy
FC. The JDK is from Sun, and didn't come as a RPM. Best, Andy From: Peter Dalgaard Logan Lewis [EMAIL PROTECTED] writes: Andy, On Tuesday 03 October 2006 3:30 pm, Liaw, Andy wrote: Before I do that, I would need to remove the gcj stuff that are in /usr/bin. If I know how

Re: [R] how to convert all columns of a data frame into factors

2006-10-04 Thread Liaw, Andy
Alternatively: x[] - lapply(x, factor) Recall that a data frame is a list, so lapply() is a natural choice. Andy From: Gabor Grothendieck Try this: replace(BOD, TRUE, lapply(BOD, factor)) On 10/4/06, Weiwei Shi [EMAIL PROTECTED] wrote: Hi, I use apply apply(x, 2, factor)

Re: [R] Help on Random forest [Broadcast]

2006-10-11 Thread Liaw, Andy
Do provide a reproducible example, as the Posting Guide suggests. Try: library(randomForest) example(predict.randomForest) iris.pred - predict(iris.rf, iris[ind == 2,], nodes=TRUE) str(iris.pred) attr(iris.pred, nodes) Andy From: Rupendra Hello all, I am trying to explore random forest

RE: [R] predict.mvr error message

2004-08-26 Thread Liaw, Andy
What version of R, what version of pls.pcr, and on what OS? Have you checked whether your versions of software are up to date? I get: n - 1350 p - 180 y - rnorm(n) x - matrix(sample(0:1, n*p, replace=TRUE), n, p) fit - mvr(x, y, method=SIMPLS, validat=none, ncomp=2) xt -

RE: [R] Surprise when mapping matrix to image

2004-08-26 Thread Liaw, Andy
From: Richard A. O'Keefe [snip] Given the wide range of ways that the x, y, z arguments can be passed to image(), it would actually make sense to have some kind of flip and/or mirror operations specified via an argument to image(). The source code of image is available (image.default) so it

RE: [R] removing invariant columns from a matrix

2004-08-28 Thread Liaw, Andy
Something like: keep - apply(myData, 2, function(x) diff(range(x)) 0) newData - myData[, keep] Andy From: Moises Hassan I'm looking for an efficient way of removing zero-variance columns from a large matrix. Any suggestions? Thanks, - Moises

RE: [R] blockwise sums

2004-08-31 Thread Liaw, Andy
If you insist, here's one way: my.blockwisesum - function(x, n, ...) { tapply(x, seq(1, length(x), by=n), sum, ...) } Andy From: Lutz Prechelt I am looking for a function like my.blockwisesum(vector, n) that computes sums of disjoint subsequences of length n from vector and can

RE: [R] blockwise sums

2004-08-31 Thread Liaw, Andy
From: Barry Rowlingson Liaw, Andy wrote: If you insist, here's one way: my.blockwisesum - function(x, n, ...) { tapply(x, seq(1, length(x), by=n), sum, ...) } Did you test that? I get: Of course not (slap on wrist)!! My apologies... Andy my.blockwisesum(1:10, 3

RE: [R] Membership

2004-09-01 Thread Liaw, Andy
http://cran.r-project.org/src/contrib/cluster_1.9.6.tar.gz Andy From: Kannnan Dear sir, I like to change the objective function in fanny function(fuzzy clustering) and I like to modify the membership function in constructing membership grade to objects to the class. So I kindly

RE: [R] How to personalize the rpart function: t.default(x)

2004-09-01 Thread Liaw, Andy
On top of what Rolf had said, traceback() would help tracking down how the error happened. Andy From: Rolf Turner t is for transpose; look at ?t, ?t.default, ?t.data.frame Bottom line: Somewhere in your code you are trying to transpose something that is not a matrix. (Or you are

  1   2   3   4   5   6   7   8   9   10   >