Edgar,
Based on the information provided its difficult to thoroughly answer your
question. But I will assume that you have samples within each year, say
weekly or monthly. Based on this I would say that you can treat the years as
a random effect but I dont think that I would do it the way that you
You are creating a new object, but the columns that are stored as factors are
not being 'refactored' so you are retaining the original list of levels. To fix
this you can use the factor function after you subset
pa2 = subset(pa, influencia=="AID")
pa2$influencia<-as.factor(pa2$influencia)
On
Etienne Laliberté wrote:
Here's one way.
# create matrices x and y with some sites in common
x <- matrix(1, 4, 2) ; rownames(x) <- letters[1:4]
y <- matrix(1, 4, 2) ; rownames(y) <- letters[3:6]
# identify which sites are in common for x and y
xcommon <- rownames(x) %in% rownames(y)
ycommon <-
Mango,
I believe what you have is the right idea. There are some things you could do
that might speed it up. For example, don't search for c('B',1,2), r will need
to convert those all to characters first. Instead ask if exp$marker=='0'.
Another thing you could do is create an empty vector to sto
On Jan 11, 2011, at 6:58 AM, "B.-Markus Schuller"
wrote:
> Hey,
>
> I have a vector containing mostly zeroes. At varying positions are markers
> that mark different channels ("B", 1, 2).
>
> > head(exp$Marker, 100)
> [1] "B" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0"
Julia,
## Lets say that you read your data in and called it x
x<-read.csv("mydata.csv")
## and that dataset had 3 columns in it; date, lat and long
plot(lat~long,x)
## or
plot(x$lat~x$long)
## or
plot(x$long, x$lat)
## for more help with the plot function (additional arguments and the
like) ente
Zongshan,
When you use cbind, R will combine them as a matrix and unfortunately
the $ way of indexing columns does not work for matrices. A better way
to get what you want would be like this:
data<-data.frame(jan=npp$JAN,feb=npp$FEB)
Hope this helps,
Chris
Zongshan, Li wrote:
Dear
You just need to make sure that your factors are read as factors and not
numbers. The easiest way to do that is to specify the column types right
when you read in your data
Try this:
seedL<-read.delim("SeedL.txt.txt",colClasses=c("factor","factor","factor","factor","numeric","numeric"))
cmod<-lmer