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?
, 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
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
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
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.
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).
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()
##
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
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)
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
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
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)
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),
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:
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
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
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
-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
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
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
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
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!
--
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
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
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
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
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
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
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
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
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
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
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)
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
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.,
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
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.
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
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
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
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 -
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 -
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
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
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,
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
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,
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
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))
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
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)
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
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
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
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?
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
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
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...
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=))
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
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
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
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
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
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],
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
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
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
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()
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
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
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
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,
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
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
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
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
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
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
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
. 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
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
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
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
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?
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
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
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
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
-
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
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
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)
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
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 -
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
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
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
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
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
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 - 100 of 1656 matches
Mail list logo