Dear all,
I have data from a time span like this:
myframe <- data.frame (Timestamp=c("24.09.2012 09:00:00", "24.09.2012
10:00:00","25.09.2012 09:00:00",
"25.09.2012 09:00:00","24.09.2012 09:00:00",
"24.09.2012 10:00:00"),
Event=c(50,60
the two subsets and concatenate them:
myframe[c(sample(which(myframe$day==days[1]),2),
sample(which(myframe$day==days[2]),2)),]
Jim
On Fri, Dec 7, 2018 at 8:08 PM Dagmar Cimiotti
wrote:
Dear all,
I have data from a time span like this:
myframe <- data.frame (Timestamp=c("24.09.201
$day)
>
> Then just sample the two subsets and concatenate them:
>
> myframe[c(sample(which(myframe$day==days[1]),2),
> sample(which(myframe$day==days[2]),2)),]
>
> Jim
>
>
> On Fri, Dec 7, 2018 at 8:08 PM Dagmar Cimiotti
> wrote:
>> Dear all,
>>
>
?
Regards,
Marc Schwartz
> On Dec 7, 2018, at 7:18 PM, Dagmar
> Cimiotti wrote:
>
> Hi Jim and everyone else,
>
> Mhm, no this is not what I am looking for. I think in your way I would
> randomly sample two values of day 1 and of day 2. But I want the
> opposite: I w
] "2012-10-14" "2012-10-15" "2012-10-16" "2012-10-17" "2012-10-18"
Now, use the result of the above to subset your data frame. See ?subset and
?"%in%":
myframe.rand <- subset(myframe, day %in% seq(start, length.out = 25, by =
&quo
Hello,
It must be very easy.
I have data like this:
myframe <- data.frame (ID=c("Ernie", "Ernie", "Ernie", "Bert",
"Bert","Bert", "Duck"), Hunger=c(1,1,1,2,2,1,3) )
myframe
bighunger <- subset (myframe, myframe$Hunger>=2 &myframe$Hunger <3 )
bighunger
verybighunger <- subset(myframe,myframe$Hun
6 matches
Mail list logo