search for: datasubset

Displaying 5 results from an estimated 5 matches for "datasubset".

2011 Mar 15
3
create data set from selection of rows
Readers, For a data set: text1,23,text2,45 text1,23,text3,78 text1,23,text3,56 text1,23,text2,45 The following command was entered: datasubset<-data.frame(dataset[,3]=="text3") The result of datasubset is TRUE TRUE The required result is text1,23,text3,78 text1,23,text3,56 What is the correct command to use please? Thanks in advance.
2012 Oct 29
2
naming datasubsets in a loop
Hello everbody, I want to generate different subsets of my data-set and safe this subsets with names listet in a vector. Because in reality I have got about 70 subsets I want to realize this in a loop Somehow like this: names=c("nam1",
2008 Oct 13
2
Subset based on items in a list.
...umns ("ID") in my data frame contains a list of ids, many of which appear more than once. I'd like to find the subset of my data frame for which "ID" matches one of the numbers in "ID_list." I'm pretty sure I could write a function to do this--something like: dataSubset<-function(df, id_list){ tmp = data.frame() for(i in id_list){ for(j in 1:dim(df)[1]){ if(i==df$ID[j]){ tmp<-data.frame(df[j,]) } } } tmp } but this seems inefficient. As I understand it, the subset functi...
2012 Mar 15
2
ggplot2: goem_smooth and suppress messages
Hi When I run my script using ggplot and geom_smooth I get messages that I would like to suppress: p <- ggplot(dataSubset) p <- p + aes(x = as.Date(factor(key),format="%Y%m%d")) + geom_line() p <- p + geom_smooth(span=0.2,se=FALSE,size=0.7) The messages look like this: geom_smooth: method="auto" and size of largest group is <1000, so using loess. Use 'method = x' to change the smo...
2011 Sep 08
2
help subsetting data based on date AND time
...m to cast the NewDateTime field correctly (at least it appears to be in the correct format, and I assume R sees the field as a date and a time) but I am then unable to subset the data using instructions such as: with(DataSet, subset(DataSet, DataSet$NewDateTime < '2004-08-05 14:15:00')) DataSubset <- subset(DataSet, DataSet$NewDateTime < '2004-08-05 14:00:00', select = DataSet) I have tried also separating the date and time fields in the input file, and casting with instructions such as: DataSet$NewTime <- strptime(DataSet$Time, '%H:%M:%S') DataSet$NewTime <- as...