Correction:
b$label <- cut(b$timestamp, breaks=bks, labels=lbs, include.lowest = T,
right=F)
-
A R learner.
--
View this message in context:
http://r.789695.n4.nabble.com/Merging-columns-along-time-line-tp2289147p2289401.html
Sent from the R help mailing list archive at Nabble.com.
___
I take this case as cut a data set by breaks and assign each segment a label
name.
a <- data.frame(timestamp=c(3,5,8), mylabel=c("abc","def","ghi"))
b <- data.frame(timestamp=c(1:10))
bks <- c(a$timestamp,max(b$timestamp))
lbs <- a$mylabel
b$label <- cut(b$timestamp, breaks=bks, labels=lbs, inclu
I am resending this, as I believe it has not arrived on the mailing
list when I first emailed.
I have a set of labels arranged along a timeframe in a. Each label has
a timestamp and marks a state until the next label. The dataframe a
contains 5 such timestamps and 5 associated labels. This means,
Yes.
data.df[,wcol,drop=FALSE]
For an explanation of drop see ?"[.data.frame"
"Chuck White" wrote in message
news:20100202212800.o8xbu.681696.r...@mp11...
> Additional clarification: the problem only comes when you have one column
> selected from the original dataframe. You need to make the fo
Additional clarification: the problem only comes when you have one column
selected from the original dataframe. You need to make the following
modification to the original example:
data.df <- data.frame(aa=c(1,1,0), cc=c(1,0,0), aab=c(0,1,0), aac=c(0,0,1),
bb=c(1,0,1))
And, the following seem
Hello -- I am trying to merge columns in a dataframe based on substring matches
in colnames. I would appreciate if somebody can suggest a faster/cleaner
approach (eg. I would have really liked to avoid the if-else piece but rowSums
does not like that). Thanks.
data.df <- data.frame(aa=c(1,1,0),
Hi! All
I am trying to merge very large data sets. Here fullset1 contains 13
data sets. Each data set has columns which I need to merge.
Here I am trying to merge columns 2,6,10,14till end for all 13
data sets in fullset1. But I am only getting 2nd column here.
Rchan1 = sapply(1:length(fullse
7 matches
Mail list logo