Hello,
My example with 'x' was just that, an example. Inline.
Em 06-10-2012 00:03, Jhope escreveu:
Hi,
I have tried the script posted but received the following errors. I hope I
copied it correctly. I'm sorry but I don't know how to alter the script
myself.
Please advise, Jean
x <- 0:30 + r
Hi,
I have tried the script posted but received the following errors. I hope I
copied it correctly. I'm sorry but I don't know how to alter the script
myself.
Please advise, Jean
> x <- 0:30 + runif(124)
> data.to.analyze$VegIndex <- cut(x, breaks = seq(0, 35, 5))
Error in `$<-.data.frame`(`*tm
Hi Thanks to all for posting!
In plyr I did try something similar, a combination of what I learned from
all who replied. It seemed to work. If anyone knows of any criticism about
the grouping structure please let me know. I need this to be accurate.
Grouping defined by (0-5m) (6-10m) (11-15m) (16
Hello,
That now seems to be a presentation problem. See this example:
x <- 0:30 + runif(124)
y <- cut(x, breaks = seq(0, 35, 5))
l <- levels(y)
l1 <- sub("\\]", ")", l[1])
l2 <- as.numeric(sub("\\(([[:digit:]]+),.*", "\\1", l[-1])) + 1
l3 <- sub(".*,([[:digit:]]+).*", "\\1", l[-1])
l.new <- c(
From: Jhope
To: r-help@r-project.org
Cc:
Sent: Friday, October 5, 2012 3:38 AM
Subject: Re: [R] Creating vegetation distance groups from one column
Thank you! That has worked for me when creating graphs. In plyr I used the
script:
# Veg Index
data.to.analyze$VegIndex <- cut(data.to.analyze$Veg,
Thank you! That has worked for me when creating graphs. In plyr I used the
script:
# Veg Index
data.to.analyze$VegIndex <- cut(data.to.analyze$Veg,
breaks=seq(0, 35, 5), include.lowest=TRUE)
VegIndex <- data.to.analyze$VegIndex
plot(VegIndex)
But the vegetation distances on the x-axis in t
Try this
data.to.analyze$VegIndex <- cut(data.to.analyze$Veg,
breaks=seq(0, 70, 5), include.lowest=TRUE)
plot(data.to.analyze$VegIndex)
Jhope wrote on 10/04/2012 02:25:09 PM:
>
> Hi,
>
> Allow me to recap my question. In plyr I am trying to group distances of
> nests to the vegetati
Hi,
Allow me to recap my question. In plyr I am trying to group distances of
nests to the vegetation into classes that are defined by (0-5m, 6-10m,
11-15m, 16-20m, 21-25m, 26-30m, 31-35m). Each row is a nest and all the
distances to the vegetation is in a column.
As well I would like to create c
Hello,
Without sample data it's difficult to give an answer but see ?cut.
To give a data example, the best way is to use ?dput().
dput( head(mydata, 30) ) # Paste the output of this in a post
Hope this helps,
Rui Barradas
Em 04-10-2012 08:27, Jhope escreveu:
Hi R listers,
I am trying to gro
Jean,
Take a look at the cut() function,
?cut
For example ...
mydf <- data.frame(nest=1:100, d2veg=runif(100, 0, 60))
mydf$dgroup <- cut(mydf$d2veg, breaks=seq(0, 70, 5), include.lowest=TRUE)
head(mydf)
(another) Jean
Jhope wrote on 10/04/2012 02:27:38 AM:
>
> Hi R listers,
>
> I am tryi
Hi R listers,
I am trying to group distances of nests to the vegetation into classes that
are define by (0-5m, 6-10m, 11-15m, 16-20m, 21-25m, 26-30m, 31-35m, 36-40m,
41-45m, 46-50m, 51-55m, 56-60m). Each row is a nest and all the distances to
the vegetation is in a column.
In plyr, I have trie
11 matches
Mail list logo