Displaying 20 results from an estimated 1000 matches similar to: "boxplots: yaxp does not work"
2010 Sep 26
2
Changing x-axis on boxplot
Dear List,
?
I am creating a boxplot with two subsets, very similar to the example by Roger
Bivand at ?boxplot (reproduced below).? I am trying to change the labels on the
x-axis to have one number to cover both subsets.? I can do this in other plots
by using axis=FALSE followed by a separate axis() command.? I have also tried
variations in the names= argument but can't get it to work.?
2008 Sep 12
2
Again, about boxplot
Thank you for your guys reply for my previous question. But I got one more
question about the boxplot. With the code in the R-help:
boxplot(len ~ dose, data = ToothGrowth,
boxwex = 0.25, at = 1:3 - 0.2,
subset = supp == "VC", col = "yellow",
main = "Guinea Pigs' Tooth Growth",
xlab = "Vitamin C dose mg",
ylab =
2008 Feb 04
7
adding the mean and standard deviation to boxplots
Dear list,
How can I add the mean and standard deviation to each of the boxplots using the example provided in the boxplot function?
boxplot(len ~ dose, data = ToothGrowth,
boxwex = 0.25, at = 1:3 - 0.2,
subset = supp == "VC", col = "yellow",
main = "Guinea Pigs' Tooth Growth",
xlab = "Vitamin C dose mg",
2008 Oct 16
4
counting the frequencies of a vector
Hi,
Is there a function which counts the frequencies of the occurence of a
number within an interval?
for example I have this vector:
x <- c(1, 3, 1.2, 5, 5.9)
and I want a vector that gives me the frequencies within an interval
of 2, beginning at 0
(so the intervals are 0-2, 2-4, 4-6 and so on)
so I get these frequencies:
2, 1, 2
Which functions do I have to use for this purpose?
2009 Jan 17
2
splitting a string / finding a numeric value within a string
Hi,
I have this variable;
x <- c("test_01.log")
and I want to extract the number (01) out of the variable.
So that I get;
> x
[1] 1
I tried strsplit, but I don't know how to refer to the result.
Can someone help me with that?
[[alternative HTML version deleted]]
2009 Jan 12
2
writing an own function - is.factor
Hi,
I try to write an own function in R.
I want a summary table with descriptive statistics.
For example, I have this data.frame:
d <- data.frame(c(rep("m",5), rep("f",5)), c(1:10))
names(d) <- c("x", "y")
d
x y
1 m 1
2 m 2
3 m 3
4 m 4
5 m 5
6 f 6
7 f 7
8 f 8
9 f 9
10 f 10
now I want to get the mean and
2009 Jan 17
3
converting multiple variable numbers
thanks for the great help!
But I have one additional question (hope I can work alone then);
I want to replace the values of a vector, like this:
x <- c(1,2,2,3,3,4,4,4,5,1)
x[x==1] <- c(12)
x[x==2] <- c(13)
x[x==3] <- c(17)
x[x==4] <- c(20)
x[x==5] <- c(22)
is there a way to do that just in one or two code lines?
I tried
x[x == c(1:5)] <- c(12,13,17,20,22)
but that
2008 Dec 16
2
converting a data-frame by a defined rule
Hi,
I have a data frame with several columns.
Now I want to transfer the data into a new variable (also a data
frame), but I only want a part of the data, defined by a rule ...
for example; I have following data frame:
row1 row2 row3
x 2 3
x 1 4
y 5 3
y 2 3
I know want a data frame, only with lines containing x in row1.
I know how to do that for one row (f <-
2007 Nov 21
1
Manipulating x axis in stripchart
Hi all,
I I need to manipulate the x axis in a stripchart.
I will use one of the data sets included in R to
explain what I need to do.
attach(ToothGrowth)
stripchart(len[supp=='VC']~dose[supp=='VC'],
vertical=TRUE, group.names=c('A','A','A'))
stripchart(len[supp=='OJ']~dose[supp=='OJ'], add=TRUE,
vertical=TRUE, at=c(1:3)+.1,
2011 Feb 11
1
How to compute "yaxp" and "usr" without plotting ?
Dear all,
I'd like to know how I could compute the parameters "yaxp" and (the y
components of) "usr" without having to plot the data first. Note that
"ylim" is /a priori/ fixed.
The aim is to automatically adjust the parameter "mgp" without having to
make the plot twice. Then, with "yaxp" and "usr" known, it should be
easy to
2010 Nov 20
10
An empty grey diagram
Hi folks,
Win7 64bit
R 1.12.0
I run following command on R:-
> ToothGrowth
> attach(ToothGrowth)
> plot(dose,len)
> matrics=lm(len~dose)
> abline(metrics)
Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) :
plot.new has not been called yet
Only a grey diagram is displayed without content
> plot(abline(metrics))
Error in int_abline(a = a, b = b, h = h, v
2008 Sep 11
4
About "Plot.new"
Hi, sorry for bothering your guys.
I will trying to make some nice graph using boxplot. when I check the help
file of boxplot, there is a sample code as:
boxplot(len ~ dose, data = ToothGrowth, add = TRUE,
boxwex = 0.25, at = 1:3 + 0.2,
subset = supp == "OJ", col = "orange")
legend(2, 9, c("Ascorbic acid", "Orange juice"),
2009 Jul 25
1
yaxp problem for more irregular time series in one plot
Good day,
I'm trying to get more time series in one plot. As there are bigger
differences in values of variables I need logaritmic y axis.
The code I use is the following:
nvz_3_data <- read.csv('/home/tomas/R_outputs/nvz_3.csv')
date <- (nvz_3_data$date)
NO3 <- (nvz_3_data$NO3)
NH4 <- (nvz_3_data$NH4)
date_p <- as.POSIXct(date, "CET")
par(mfrow=c(2,1), ylog
2008 Jul 29
3
placing a text in the corner of a plot
Is there an easy way to add a text into an R-plot and place it in the
upper left corner?
Like that:
--------------------------------
| (a) |
| |
| |
| |
| |
| |
2009 Feb 08
1
sub() with "+" - invalid regular expression
Hi,
can someone help me;
I don't understand why this code doesn't do what it's supposed to do;
x <- c("F+", "F+")
x <- sub("F+", "F", x)
x
[1] "F+" "F+"
(I want "F" "F")
when I try this;
x <- c("F+", "F+")
x <- sub("+", "", x)
x
I get an error
2009 Jan 17
5
changing a range of values
Hi,
If I have following vector;
x <- c(1,1,1,2,2,3,4,4,5)
and I want to change values in the range of 1 to 3 into the value 1,
how can I do that?
I tried
x[x == c(1:3)] <- c(1)
but than I get;
x
[1] 1 1 1 2 1 1 4 4 5
R doesn't change the 2 into a 1.
But why?
2001 Jul 25
2
pch with plot and legend
I'm trying to plot a scatterplot of two variables using pch to plot
different characters based on a third factor. Here is my example
> data("ToothGrowth")
> attach(ToothGrowth)
> levels(supp)
[1] "OJ" "VC"
> plot(len ~ dose,pch=as.numeric(supp))
> legend(locator(1),pch=as.numeric(supp),legend=levels(supp))
The command as.numeric(supp) returns 2 2
2011 Aug 15
2
Missing datasets (2.13.1)
Dear all
How does one resolve the variance between the actual availability of data
sets in the default implementation with those mentioned in the
documentation?
I am unable to attach some of the datasets, even though help() is available
for the same datasets. For example, "ToothGrowth" is a dataset that is
widely mentioned in the documentation as being part of the base install.
2002 Mar 10
1
xaxp and yaxp
Hello,
I'm new to R, and I'm trying to set the number of tickmarks for a plot
using xaxp, but R seems to ignore this setting completely. Maybe you've
an idea what I'm doing wrong. I'm using R 1.4.1, and here's hat I'm
doing:
> d[,'seq']
[1] 28913 16323 13922 6237 4257 3881 4100 3781 2694 2064 1769
1550
[13] 1539 480
>
2006 Nov 17
2
s.e. on interaction plots
Is it possible to add standard error bars to the means on interaction plots?
Thanks
Murray
--
Murray Pung
Statistician, Datapharm Australia Pty Ltd
0404 273 283
[[alternative HTML version deleted]]