add_trend.Rd
This function adds a column to a dataset, running from 1 to the length of the data set. If the data set is segmented using the group_by function, a column is added for every subset.
add_trend(av_state, subset_id = 1, varname = "index", log_level = 0)
av_state | an object of class |
---|---|
subset_id | either an integer subset index or the the value for the |
varname | the name of the newly created indexing column. Will be postfixed with underscores if the column already exists |
log_level | sets the minimum level of output that should be shown (a number between 0 and 3). A lower level means more verbosity. Specify a log_level of 3 to hide messages about the columns being added. |
# NOT RUN { av_state <- load_file("../data/input/pp1 nieuw compleet.sav") av_state <- add_trend(av_state) column_names_output(av_state) av_state$data[[1]][c('index','index2')] # }