select_range.Rd
This function selects which rows of a data set should be included. Either the begin
or the end
argument need to be specified. The column does not need to be sorted for this function to work. Values are included if they are >= begin
and <= end
, if specified, for the specified column. Values that are NA
are never removed by this function.
select_range(av_state, subset_id = 1, column, begin, end)
av_state | an object of class |
---|---|
subset_id | either an integer subset index or the the value for the |
column | specifies which column the |
begin | indicates which values should be included. Values that are |
end | indicates which values should be included. Values that are |
This function returns the modified av_state
object.
# NOT RUN { av_state <- load_file("../data/input/pp2 nieuw compleet_64dagen.sav",log_level=3) av_state <- order_by(av_state,'tijdstip') print(av_state) av_state$data[[1]]['tijdstip'] # default column is the order_by column in this case: av_state <- select_range(av_state,begin=20,end=40) print(av_state) av_state$data[[1]]['tijdstip'] av_state <- load_file("../data/input/pp2 nieuw compleet_64dagen.sav",log_level=3) print(av_state) av_state$data[[1]]['lnSomPHQ'] # now only retain rows with 0 <= lnSomPHQ <= 2 av_state <- select_range(av_state,column='lnSomPHQ',begin=0,end=2) print(av_state) av_state$data[[1]]['lnSomPHQ'] # }