michael watson (IAH-C bbsrc.ac.uk> writes:
:
: Hi
:
: I'm seeing some "odd" behaviour with cbind(). My code is:
:
: > cat <- read.table("cogs_category.txt", sep="\t", header=TRUE,
: quote=NULL, colClasses="character")
: > colnames(cat)
: [1] "Code""Description"
: > is.factor(cat$Code)
Jean Eid chass.utoronto.ca> writes:
:
: You can do the following also
:
:
: X <- matrix(c(1,2,1,2,1,3,1,4), ncol=2)
: Y<-unique(X)
: Y[which.max(apply(Y, 1,function(i) sum(apply(matrix(1:nrow(X)),
: 1,function(x) identical(X[x,], i[1:2]),]
:
: I do not know what your strategy is when ther
Can you show how you called randomForest() and predict.randomForest()? The
error message came from the code:
if (is.data.frame(x)) {
[changing ordered factors to numeric...]
cat.new <- sapply(x, function(x) if (is.factor(x) &&
!is.ordered(x))
length(l
I have a data.frame with a series of variables tagged to a binary
response ('present'/'absent'). I am trying to use randomForest to
predict present/absent in a second dataset.After a lot a fiddling
(using two data frames, making sure data types are the same, lots of
testing with data that work
Arggh! start and end. Of course. How stupid of me. And I'm not going to
interpolate with smooth.spline, but thanks for the warning. Sloppy language.
Thanks, Andy
> -Original Message-
> From: Liaw, Andy [mailto:[EMAIL PROTECTED]
> Sent: Friday, December 10, 2004 2:49 PM
> To: 'Andy Bunn';
You've got the wrong list: This is R-help, not S-news. Besides, wouldn't
such questions be covered in the S-PLUS Programmer's Guide?
Andy
> From: [EMAIL PROTECTED]
>
> Hi,
>
> Does anybody know if S-plus Connect/C++ lib can handle
> complex number? I need to use complex matrix.
>
> Thanks
> From: Andy Bunn
>
> Preamble: Sorry for being dense.
>
> Now that that's done, here are my questions.
>
> I want to put a polygon on a plot of a time series. I'm going
> to add lines
> from a smooth.spline interpolation and other annotation to
Please note: smooth.spline() is for _smoothing_
Hi,
Does anybody know if S-plus Connect/C++ lib can handle complex number? I need
to use complex matrix.
Thanks vey much.
wz
[[alternative HTML version deleted]]
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-he
Preamble: Sorry for being dense.
Now that that's done, here are my questions.
I want to put a polygon on a plot of a time series. I'm going to add lines
from a smooth.spline interpolation and other annotation to it. But here's
the general idea:
# Start code
n <- 121
dat <- rnorm(n)
Bert:
Thanks for your reply. Actually, "mat" was a data.frame, not a matrix.
Mike
- Original Message -
From: "Berton Gunter" <[EMAIL PROTECTED]>
To: "'Mike Saunders'" <[EMAIL PROTECTED]>; "'R Help'"
<[EMAIL PROTECTED]>
Sent: Friday, December 10, 2004 11:57 AM
Subject: RE: [R] subset bug?
The subset() Help file says
"The select argument exists only for the method for data frames ..."
So if mat is a matrix and not a data.frame, this might be the source of your
problems.
-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
"The business of the statistician is
Newbies (and others!) may find the R Reference Card made available by Tom
Short and Rpad at http://www.rpad.org/Rpad/Rpad-refcard.pdf useful. It
categorizes and organizes a bunch of R's (S's) basic, most used functions so
that they can be easily found. For example, paste() is under the "Strings"
> Here's something that works. I'm sure there are better solutions (in
> particular the paste part - I couldn't figure out how to avoid typing
> a[i,1], ..., a[i,10]).
This is a language issue that arises frequently. One standard approach is to
use do.call() as in:
... result <- do.call("paste",a
> "RichOK" == Richard A O'Keefe <[EMAIL PROTECTED]>
> on Tue, 7 Dec 2004 14:35:22 +1300 (NZDT) writes:
RichOK> I've made one important change to
RichOK> http://www.cs.otago.ac.nz/staffpriv/ok/R-help.txt
now that the server there is responsive again,...
Thank you very much, Ri
Sergei Zuyev wrote:
Hello,
I am wondering if there has been a solution to the following issue with R
under Windows (see also thread to PR#6662 in this mailing list:
http://tolstoy.newcastle.edu.au/R/devel/04a/0550.html )
I am using R for teaching students Statistics, so they are working with a
u
Probably you called the build-in rainwbow-function, which returns a string.
>str(rainbow(10))
chr "FF"
Dieter Menne
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-proje
You can do the following also
X <- matrix(c(1,2,1,2,1,3,1,4), ncol=2)
Y<-unique(X)
Y[which.max(apply(Y, 1,function(i) sum(apply(matrix(1:nrow(X)),
1,function(x) identical(X[x,], i[1:2]),]
I do not know what your strategy is when there are multiple maxima i.e two
different rows appear at
This is of the nature of an FAQ. Data frames coerce character
vectors into factors. If you want a character vector to stay
that way (and not become a factor) wrap in up in ``I()'':
cat <- cbind(cat,Color=I(rainbow(nrow(cat
(There's no need to quote the name ``Color'' in the foregoi
cat is a data.frame,
so cbind is use for a data.frame
and
?data.frame tell us that:
Character variables passed to 'data.frame' are converted
to factor columns unless protected by 'I'.
PS : it is not good ides to call your data.frame cat as there is a cat
function.
At 09:19 10/12/2004, mich
I'm using R 1.9.1 on suse server v9 enterprise with the gee package version
4.13-10.
I have code that runs in an automated script. It uses the gee function from
the gee package. The script is run quite often without error.
I have a problem where the script locks up R when calling this function (i
Hi
I'm seeing some "odd" behaviour with cbind(). My code is:
> cat <- read.table("cogs_category.txt", sep="\t", header=TRUE,
quote=NULL, colClasses="character")
> colnames(cat)
[1] "Code""Description"
> is.factor(cat$Code)
[1] FALSE
> is.factor(cat$Description)
[1] FALSE
> is.factor(rain
bogdan romocea wrote:
Here's something that works. I'm sure there are better solutions (in
particular the paste part - I couldn't figure out how to avoid typing
a[i,1], ..., a[i,10]).
a <- matrix(nrow=1000,ncol=10)
for (i in 1:1000)
for (j in 1:10)
a[i,j] <- sample(1:0,1)
b
Here's tow examples that do what you want (the way I understand them).
layout(matrix(c(1,0,1,0), byrow = TRUE))
plot(10:100)
par(xpd=NA)
co <- par("usr")
legend(co[1], -10, legend=c("Hello long time no see","\n" , "and My day
was great","\n", "How was yours"), text.width=95, col="red",,
text.col
Here's something that works. I'm sure there are better solutions (in
particular the paste part - I couldn't figure out how to avoid typing
a[i,1], ..., a[i,10]).
a <- matrix(nrow=1000,ncol=10)
for (i in 1:1000)
for (j in 1:10)
a[i,j] <- sample(1:0,1)
b <- vector(mode="char
On Thu, 9 Dec 2004 16:46:27 -0600, "Bang" <[EMAIL PROTECTED]> wrote :
>I recently installed the new base.
>
>Code that I had been successfully using for a spatial model is now giving
>the following message when it reads the "Y" variable in the command:
>
>y <- model.response(mf, "numeric")
>
>The
I ran into a problem with "subset" while working at home that I am not sure is
a bug or not. I defined a custom function to take a data frame of tree
positions, sizes, and types (containing the columns TRT, COMP, PLOT, X, Y, DBH
and CON) and wanted to make a stem map of the plot using different
On Fri, 10 Dec 2004, michael watson (IAH-C) wrote:
> Hi Petr
>
> Yes thanks I did get your response and it was helpful. However, I have
> now resorted to using barplot() to draw a legend (as all I wanted was
> colored boxes and text) and it works very well for my needs.
>
> Basically, with layout
On Fri, 10 Dec 2004, Puneet Singh wrote:
> Hi all,
>
> I am currently optimising a small portfolio I have
> created as a part of my research project in Excel. I
> am unable to find the appropriate package to port this
> into R. My problem set up is as follows
>
> Minimise ABS(Sum(Xi-Xi')+10*Sum(Xi
On 10 Dec 2004 at 12:20, michael watson (IAH-C) wrote:
> Hi Petr
>
> Yes thanks I did get your response and it was helpful. However, I
> have now resorted to using barplot() to draw a legend (as all I wanted
> was colored boxes and text) and it works very well for my needs.
>
> Basically, wit
Hi Petr
Yes thanks I did get your response and it was helpful. However, I have
now resorted to using barplot() to draw a legend (as all I wanted was
colored boxes and text) and it works very well for my needs.
Basically, with layout() I'm not getting what I would expect, which may
be a problem w
On 10 Dec 2004 at 11:47, michael watson (IAH-C) wrote:
> Hi
>
> I have a function which draws a plot, using the layout() function to
> divide the screen into two parts. The function works fine, but then
> my next call to plot() draws the plot in the first section of the plot
> I've just drawn
Hi all,
I am currently optimising a small portfolio I have
created as a part of my research project in Excel. I
am unable to find the appropriate package to port this
into R. My problem set up is as follows
Minimise ABS(Sum(Xi-Xi')+10*Sum(XiMi)/Mavg)
Subject to:
0 <= Xi <= 0.05
ABS(Sum(Xi)) = 0.
Hi
I have a function which draws a plot, using the layout() function to
divide the screen into two parts. The function works fine, but then my
next call to plot() draws the plot in the first section of the plot I've
just drawn using layout() - whereas what I want it to do is create a new
plot.
I
On Fri, 10 Dec 2004, Leonardo Lami wrote:
> Hi,
> I'd like plot a bar graphic of a array.
> I'd like to have the values of the single columns as juxtaposed bars (like in
> "barplot" with beside=TRUE) and I'd like to have the values of the single
> columns expressed like percentage of the sum of
Hi,
I'd like plot a bar graphic of a array.
I'd like to have the values of the single columns as juxtaposed bars (like in
"barplot" with beside=TRUE) and I'd like to have the values of the single
columns expressed like percentage of the sum of the coloumn.
In this way all the bars are composed b
Hi,
I'd like plot a bar graphic of a array.
I'd like to have the values of the single columns as juxtaposed bars (like in
"barplot" with beside=TRUE) and I'd like to have the values of the single
columns expressed like percentage of the sum of the coloumn.
In this way all the bars are composed b
Dear nlme-lovers,
I do a fit fo a 3-parameter fit to physiological data with nlme:
EmptD<-deriv(~(vol+slope*t)*exp(-t/tempt)...
The approach described in Pinheiro/Bates by using nlsList
as a first approximator was somewhat unstable (many NA), but
a direct fit converges quickly and fits look good
Thomas Petzoldt writes:
> === lattice.Rnw==
> \documentclass[a4paper, dvips]{article}
> \begin{document}
>
> <>=
> library(lattice)
> data(iris)
> xyplot(Sepal.Length~Sepal.Width|Species, data=iris)
> @
>
> \end{document}
> ===
Hello,
I have problems using lattice graphics together with Sweave under
Windows XP and R 2.0.0; 2.0.1 Patched; 2.1.0 devel respectively.
Base graphics are o.k., but for lattice graphics empty files (.eps and
.pdf) are generated.
The only workaround I found was to write and read the respective f
Just for the records (and if anyone ever wants to find the "solution"),
I solved my own problem (well sort of) through imaginative use of the
barplot command:
>
barplot(rep(1,4),horiz=TRUE,names.arg=rev(c("this","is","my","legend")),
col=rev(rainbow(4)), axes=FALSE,las=2)
Produces a very nice, re
I'm diverting to R-devel, where this is really more
appropriate. Here (R-help) only a shorter version:
> "RichOK" == Richard A O'Keefe <[EMAIL PROTECTED]>
> on Fri, 10 Dec 2004 14:37:16 +1300 (NZDT) writes:
RichOK> In this discussion of seq(), can anyone explain to
RichOK> me
Phil and Andy,
many thanks for your help's!
regrads,christian
Phil Spector wrote:
Christian -
Perhaps this is what you are looking for:
> dat = NULL
> for(i in 1:8)dat = cbind(dat,sample(1:5,size=10,replace=TRUE))
> dat = data.frame(dat)
> tt = table(dat)
> tt1 = data.frame(tt)
> tt1
> "Chris" == <[EMAIL PROTECTED]>
> on Thu, 9 Dec 2004 22:59:13 - writes:
Chris> I am attempting to set up a mixed effects model, with
Chris> one factor fixed (put in as.factor, with three factor
Chris> levels) and one factor random(put in as.factor, with
Chris> fo
Hi Michael
I cannot find other option than
1. to go through legend code and modify it according to your
wish (especially drawing parts)
2. to use rect and text for making your own legend
3. experiment with legend settins to produce what you want
Cheers
Petr
On 9 Dec 2004 at
44 matches
Mail list logo