search for: andrewjt

Displaying 2 results from an estimated 2 matches for "andrewjt".

2011 Aug 14
2
conditional filter resulting in 2 new dataframes
This is what I am starting with: initial<- matrix(c(1,5,4,8,4,4,8,6,4,2,7,5,4,5,3,2,4,6), nrow=6, ncol=3,dimnames=list(c("1900","1901","1902","1903","1904","1905"), c("sample1","sample2","sample3"))) And I need to apply a filter (in this case, any value <5) to give me one dataframe with only the
2010 Oct 08
1
conditional replacement of contiguous values
Hello, I need help getting from data$HAVE to data$NEED (see below). This requires replacing every TRUE in data$HAVE with 4 TRUE(s) in data$NEED. Any ideas? It seems straight forward but I can't figure it out! Thanks in advance HAVE NEED 1 FALSE FALSE 2 FALSE FALSE 3 TRUE TRUE 4 FALSE TRUE 5 FALSE TRUE 6 FALSE TRUE