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
s, Si.
- Original Message -
From: "Steve Murray"
To:
Sent: Monday, May 18, 2009 12:17 PM
Subject: [R] Simple plotting errors
Dear R Users,
I have 12 data frames, each of 12 rows and 2 columns.
e.g. FeketeJAN
MEANSUM_
AMAZON 144.4997874 68348
, Si.
- Original Message -
From: "Steve Murray"
To:
Sent: Monday, May 18, 2009 12:17 PM
Subject: [R] Simple plotting errors
Dear R Users,
I have 12 data frames, each of 12 rows and 2 columns.
e.g. FeketeJAN
MEANSUM_
AMAZON 144.4997874 68348
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
, Si.
- Original Message -
From: "Steve Murray"
To:
Sent: Monday, May 18, 2009 12:17 PM
Subject: [R] Simple plotting errors
Dear R Users,
I have 12 data frames, each of 12 rows and 2 columns.
e.g. FeketeJAN
MEANSUM_
AMAZON 144.4997874 68348
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.
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.2
PARANA 58.38354
13 matches
Mail list logo