search for: sortvars2

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

Did you mean: sortvars1
2007 Sep 07
2
R first.id last.id function error
...$id) != file1$id) file1$last.id[1]<-TRUE #force NA to TRUE #resort to original order file1<- file1[order(file1$id,file1$week),] I am now trying to get the above code to work as a function, and am clearly doing something wrong: > first.last <- function (df, idvar, sortvars1, sortvars2) + { + #sort in ascending order to define first dot + df<- df[order(sortvars1),] + df$first.idvar <- (Lag(df$idvar) != df$idvar) + #force first record NA to TRUE + df$first.idvar[1]<-TRUE + + #sort in descending order to define last dot + df<- df[order(-sortvars2),] +...
2009 Feb 08
0
Modifying forestplot function in rmeta
...RUE #force NA to TRUE > >#resort to original order >file1<- file1[order(file1$id,file1$week),] > > > >I am now trying to get the above code to work as a function, and am >clearly doing something wrong: > > > first.last <- function (df, idvar, sortvars1, sortvars2) >+ { >+ #sort in ascending order to define first dot >+ df<- df[order(sortvars1),] >+ df$first.idvar <- (Lag(df$idvar) != df$idvar) >+ #force first record NA to TRUE >+ df$first.idvar[1]<-TRUE >+ >+ #sort in descending order to define last dot >+...