Re: [R] getting variables based on name

2009-10-03 Thread William Doane
This turns out to be quite easy... Given: > head(data) inst a1 a2 a3 a4 a5 a6 a7 a8 escore 11 1 1 0 1 1 0 0 0 4 21 0 1 0 0 0 0 0 0 1 31 1 0 0 1 0 1 1 1 2 41 0 1 0 0 0 1 0 0 1 You can use grep on the names of the columns in d

Re: [R] getting variables based on name

2009-10-02 Thread William Doane
This turns out to be quite easy... Given: > head(data) inst a1 a2 a3 a4 a5 a6 a7 a8 escore 11 1 1 0 1 1 0 0 0 4 21 0 1 0 0 0 0 0 0 1 31 1 0 0 1 0 1 1 1 2 41 0 1 0 0 0 1 0 0 1 You can use grep on the names of the columns in d

Re: [R] Frequency Counts per Time Period

2009-04-10 Thread William Doane
So, to complete Bill Dunlap's thought and combine it with your desired goal, I believe this gets you what you wanted... start.time <- as.POSIXct("2009-04-10 12:00:00") event.times <- start.time + c(1,2,3,61,62,122,135,200) event.values <- rnorm(length(event.times)) et <- data.frame(event.times,ev

Re: [R] Using package ROCR

2009-02-26 Thread William Doane
Responding to question 1... it seems the demo assumes you already have a plot window open. library(ROCR) plot(1,1) demo(ROCR) seems to work. For question 2, my environment produces the expected results... plot doesn't generate an error: * R 2.8.1 GUI 1.27 Tiger build 32-bit (5301) *