On Tue, Nov 3, 2015 at 6:26 PM, Robert Sherry wrote:
> I have created what I believe to be a data frame. It is called env1$SPY.
It's not a data.frame. You can use str() to look at the *str*ucture
of an object:
R> str(env1$SPY)
An ‘xts’ object on 1995-01-03/2015-11-02 containing:
Data: num [1:
Have you gone through any R tutorials? There are innumerable good ones
on the web -- and one that ships with R (An Intro to R). Don't you
think you should make an effort to learn some basics on your own
before posting here?
... or do I misinterpret your question? (And if so, my apologies --
feel f
Tena koe Robert
Many times in R one can do things without a loop. In this case, see ?rle. You
might also need to check substring or months depending on how you dates are
stored.
HTH
Peter Alspach
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of
Sun Shine wrote
> with(MHP.def, {plot(as.integer(MHP.def$Names),cH.E, axes=FALSE,
xlab='Area') axis(side=2) axis(side=1, at=seq_along(levels(MHP.def$Names)),
lab=levels(MHP.def$Names))})
Error: unexpected symbol in "with(MHP.def, {plot(as.integer(MHP.def$Names),
MHP.def$cH.E, axes=FALSE, xlab='Are
Ggplot2 also depends on factors, so learn about them asap. It does have some
support for automatically converting strings to factors in some cases, but it
doesn't always work the way you want it to.
---
Jeff Newmiller
Hello William, Ivan and Jim
I appreciate your replies.
I did suppress the factors using stringsAsFactors=FALSE and in that way
was able to progress some more on getting a sense of the data set, so
thanks for that suggestion. I had previously overlooked it.
Also thanks William, I never understo
Here is a reproducible example
> d <- read.csv(text="Name,Age\nBob,2\nXavier,25\nAdam,1")
> str(d)
'data.frame': 3 obs. of 2 variables:
$ Name: Factor w/ 3 levels "Adam","Bob","Xavier": 2 3 1
$ Age : int 2 25 1
Do you get something similar? If not, show us what you have (you
could
If you are using 'read.csv' (or 'read.table') to input, then use the 'as.is
= TRUE' parameter to prevent the conversion to factors of the data.
You can also do "as.character(df$col_with_factors)" to get the character
values back.
Jim Holtman
Data Munger Guru
What is the problem that you are try
Hi Sun,
If I understood correctly (a reproducible example would be of great
help), it seems you're struggling with factors. Read on this topic to
better understand how it works.
For your plots, you would need to set the labels with the argument
'xlab' for plot(). To access the names of the f
9 matches
Mail list logo