Displaying 20 results from an estimated 8000 matches similar to: "Plotting Factors -- Sorting x-axis"
2003 Mar 26
2
ifelse()
Hi,
I'm not sure if this can be done but..
I know that with ifelse() I can do something like:
ifelse(x <= 3, 1, 2)
to go through each element in my vector x, and if x_i <= 3 substitute the
number with 1 else with 2. Essentially I'll get a vector with 2 levels.
Can I tweak it so I can get 3-levels? For example:
if(x <= 3) then 1
elseif(3 < x <= 4) then 2
2003 Apr 06
1
Change cex.axis in biplot()
Hi,
If I do something like:
biplot(x, cex.axis = .7)
then it will only change the font size for axis 1 and 2, but not 3 and 4.
Is there a way to change the fonts on axis 3 and 4?
--
Cheers,
Kevin
------------------------------------------------------------------------------
/* Time is the greatest teacher, unfortunately it kills its students */
--
Ko-Kang Kevin Wang
Master of Science
2003 Mar 26
2
Plotting K-M Curve when have several strata
Hi,
If I have:
foo <- survfit(y ~ x)
where y is a survival object and x is a n-level factor. The documentation
says when I plot(foo), the confidence intervals will not be plotted (which
I guess is understandable as otherwise the plot will get really messy).
I tried to plot with confidence intervals by using:
plot(foo, conf.int = TRUE)
and indeed the resulting plot is messy. However
2003 May 25
1
Example Data Set(s) for nnet, rpart
Hi,
I'm doing a presentation on Neural Networks and Tree-Based Models in two
weeks, at the moment I'm looking for a data set to use in the
presentation. What I would like to use is a good old data, like the Iris
data, that is already known by every statisticians.
MASS4 uses the cpus data in Chapter 8.10 and the Cushing's syndrome in
Chapter 12.4. These two data sets plus the
2003 Apr 04
3
Sampling from a Data Frame
Hi,
I've been looking through the documentation for sample(), but can only get
it to work with vectors. Is it possible to sample from a dataframe?
--
Cheers,
Kevin
------------------------------------------------------------------------------
/* Time is the greatest teacher, unfortunately it kills its students */
--
Ko-Kang Kevin Wang
Master of Science (MSc) Student
SLC Tutor and Lab
2003 Jun 01
1
Wording of "R Installation and Administration"
Hi,
I hope I haven't got this wrong, but I don't think one needs Perl
installed if they install the "precompiled" packages for Windows right?
I'm just wondering if the first sentence in the "R Installation and
Administration" can be re-worded a bit so newbies won't get confused....
---------- Forwarded message ----------
Date: Mon, 2 Jun 2003 08:56:37 +1200
2003 May 22
1
Getting the Bootstrap Error Rate of QDA
Hi,
What does this mean when I have something like:
> qda.boot <- boot(train, qda.bootstrap, R = 500)
Error in qda.default(structure(data.matrix(x), class = "matrix"), ...) :
Rank deficiency in group M
with my qda.bootstrap() looks something like:
> qda.bootstrap <- function(data, index) {
+ boot.qda <- qda(x = data[index, 2:9], group = data[index, 1])
+ qda.pred
2003 May 19
2
To update() or not to update()?
Hi,
Suppose I have:
# Fit a base model
d1.ph <- coxph(Surv(start, stop, event)~
ejec + diavol + score + smoking +
beta + surg.done,
data = data.frame(foo))
summary(update(d1.ph, . ~ . + td1))
summary(update(d1.ph, . ~ . + td2))
As I have many columns in my data frame, foo, called td's. e.g. td1, td2,
td3, .... And I'd like to
2003 Nov 26
4
strptime Usage
Hi,
I have a column in a dataframe in the form of:
> as.vector(SLDATX[1:20])
[1] "1/6/1986" "1/17/1986" "2/2/1986" "2/4/1986" "2/4/1986"
[6] "2/21/1986" "3/6/1986" "3/25/1986" "4/6/1986" "4/10/1986"
[11] "4/23/1986" "4/30/1986" "5/8/1986"
2003 Jun 07
1
Extracting Numbers from MANOVA output
Hi,
Suppose I have:
> summary(manova(plank.man))
Df Pillai approx F num Df den Df Pr(>F)
plankton.new[, 1] 1 0.5267 9.8316 6 53 2.849e-07 ***
Residuals 58
---
Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1
My understanding is the MANOVA summary returns a list.
2003 Jun 10
1
Bootstraping with MANOVA
Hi,
Does anyone know what the error message mean?
> Boot2.Pillai <- function(x, ind) {
+ x <- as.matrix(x[,2:ncol(x)])
+ boot.x <- as.factor(x[ind, 1])
+ boot.man <- manova(x ~ boot.x)
+ summary(manova(boot.man))[[4]][[3]]
+ }
>
> man.res <- manova(as.matrix(pl.nosite) ~
+ as.factor(plankton.new[,1]))$residuals
> boot2.plank <-
2003 Apr 11
4
Can I improve the efficiency of my scan() command?
Hi,
Suppose I use the following codes to read in a data set.
###############################################
> rating <- scan("../Data/Rating.csv",
+ what = list(
+ usage = "",
+ mileage = 0,
+ sex = "",
+ excess = "",
+ ncd = "",
+
2003 Mar 10
1
rpart returning only 1 node
Hi,
This may actually be a theoretical question.
When I tried to do the following:
##########################################################
> colnames(rating.adclms)
[1] "usage" "mileage" "sex" "excess" "ncd"
[6] "primage" "minage" "drivers" "district" "cargroup"
[11]
2003 Dec 15
3
Julian Dates
Hi,
I'm a bit confused how julian() works. If I understand right, it returns
the number of days since the origin.
I have a vector:
> SLDATX[1:10]
[1] "1986-01-06" "1986-01-17" "1986-02-02" "1986-02-04"
[5] "1986-02-04" "1986-02-21" "1986-03-06" "1986-03-25"
[9] "1986-04-06"
2003 Apr 08
5
Help on smooth.spline?
Hey, R-listers
I was recommended to try using smooth.spline function
for estimating 2-Dimensinal curve given a data set.
So will you please tell me where to get this R function?
Or which package provides this function?
Thanks for your point.
Fred
2003 Sep 11
2
Sorting
What is the best way to sort a dataframe?
For example, how would I go about sorting a dataframe (with variables V1-V5)
by ascending V1, V2 and descending V3 while retaining V4 and V5.
Also, is there a relatively easy way by which to re-order my columns?
Thank you for your time.
Marc
Marc Zodet
[[alternative HTML version deleted]]
2003 May 17
2
Regression tree
Hi everybody.
I'm a new R user and i've been searching a tool for construction of
regression tree...
I found function "tree()" written by a certain Mr. Ripley, and seems to be
just
what i'm looking for, but when i try to use it in R replies me:"Object not
found".
So I was wandering if I should include one special library or something
like that?
Thanks a lot,
ana
2003 Oct 22
1
questions about axis
Dear helper.
I am a beginer.
I have difficulties to handle axis. I want to draw axis label such that axis has range of [-0.4,0.4] with intervel 0.2 for x and y axis.
Some part of range do not have data points. Thus, plot does not show whole range. How can I enforce plot to depict the whole range regardless of existence of data points ?
Another problem is that when I depict axis labels, some
2003 Nov 07
1
y label after axis (4)
Hi,
I am trying to figure out how to lable the second y-axis after the following
codes:
plot(x, y,
xlab="time",
ylab="pay1"
)
par(new=TRUE)
plot(x,y2,
ann=FALSE,
xaxt="n",
yaxt="n",
pch=7
)
axis(4)
Then, I want to label the second y axis "pay2". I tried "title(ylab="pay2")",
but it put this lable on the first
2003 Nov 07
3
Two Y-axises and One X-axis
Hi,
I would like to know if anyone knows how to draw a plot with two Y-axises and
one X-axis? When you have two sets of y values that do not have the same
scale, but correspond to the same x value, I would like to plot them on one
graph.
Could you please help me?
Thank you
Soyoko