Many thanks once more for helping me to solve this.
Gabor - I wasn't even aware of month.abb, so thanks for bringing this useful
trick to my attention!
Steve
_
[[elided Hotmail spam]]
Try this (and make sure to follow the last line to every message
on r-help which asks for reproducible code in questions):
plot(amazon.sum, xlab = "Month", ylab = "Amazon Sum", xaxt = "n")
axis(1, at = 1:12, substr(month.abb, 1, 1))
On Mon, May 18, 2009 at 8:39 AM, Steve Murray wrote:
>
> Thank
9 PM
Subject: RE: [R] Simple plotting errors
Thanks for all the useful information; use of 'c(...)' did the trick,
although in future I'll try to hold the data in a more user-friendly
setup.
I've now got a plot, but have two issues that I can't seem to resolve:
1,
Here is a slight elaboration on Jim's solution:
# create a vector of the names - month.abb is built into R
# This is like: df.names <- c("FetekeJAN", "FetekeFEB", ...)
# but avoids having to write out every name.
df.names <- paste("Feteke", toupper(month.abb), sep = "")
# create a list of the d
Thanks for all the useful information; use of 'c(...)' did the trick, although
in future I'll try to hold the data in a more user-friendly setup.
I've now got a plot, but have two issues that I can't seem to resolve:
1, The ylab is overlapping the y-axis tick mark values. I've tried using oma
you mean you want to plot "SUM" against month? (assuming these12 data frames
are 12 months).
you could first bind them all together using data.frame(), see ?data.frame
which would make it much easier.
you need to create a variable for months then plot it against your variable.
If you dont wa
you mean you want to plot "SUM" against month? (assuming these12 data frames
are 12 months).
you could first bind them all together using data.frame(), see ?data.frame
which would make it much easier.
you need to create a variable for months then plot it against your variable.
If you dont wa
On Mon, 18 May 2009 11:17:50 + Steve Murray
wrote:
SM> plot(FeketeJAN[1,2], FeketeFEB[1,2], FeketeMAR[1,2], *through to
SM> December* type="l")
SM> What is it that I'm doing wrong?!
try plot( c(FeketeJAN[1,2], FeketeFEB[1,2], ...)),type="l")
however it is better to create one big data fram
you mean you want to plot "SUM" against month? (assuming these12 data frames
are 12 months).
you could first bind them all together using data.frame(), see ?data.frame
which would make it much easier.
you need to create a variable for months then plot it against your variable.
If you dont wa
One way is to create a list of the dataframes and then use 'sapply' to
extract the values:
df.list <- list(FeketeJAN, ..., FeketeDEC)
plot(sapply(df.list, function(a) a["AMAZON", "SUM_"]))
On Mon, May 18, 2009 at 7:17 AM, Steve Murray wrote:
>
> Dear R Users,
>
> I have 12 data frames, each of
I'd suggest you first combine the 12 data.frames into one, using
melt() from the reshape package.
makeDummy <- function(.){ # since you don't provide a reproducible
example
data.frame(x=letters[1:10], y=rnorm(10))
}
listOf12DataFrames <- lapply(1:12, makeDummy)
library(re
Steve Murray wrote:
Dear R Users,
I have 12 data frames, each of 12 rows and 2 columns.
e.g. FeketeJAN
MEANSUM_
AMAZON 144.4997874 68348.4
NILE 5.4701955 1394.9
CONGO71.3670036 21196.0
MISSISSIPPI 18.9273250 6511.0
AMUR 1.8426874 466.
12 matches
Mail list logo