you can use ifelse like this
dataframe$periodframe <- ifelse(dataframe$year > 1991,"post-1991", "pre-1991")
More Related Contents:
- Repeat each row of data.frame the number of times specified in a column
- Filter data.frame rows by a logical condition
- Split column at delimiter in data frame [duplicate]
- Pass a data.frame column name to a function
- How to convert a list consisting of vector of different lengths to a usable data frame in R?
- Select groups based on number of unique / distinct values
- Assign multiple columns using := in data.table, by group
- Filtering a data frame on a vector [duplicate]
- How to replace NA values in a table for selected columns
- Remove an entire column from a data.frame in R
- Selecting multiple odd or even columns/rows for dataframe
- Sample n random rows per group in a dataframe
- Select every nth row from dataframe
- Remove Rows From Data Frame where a Row matches a String
- duplicates in multiple columns
- R – add column that counts sequentially within groups but repeats for duplicates
- Extend contigency table with proportions (percentages)
- R self reference
- Change row order in a matrix/dataframe
- Subsetting a data frame based on contents of another data frame
- Convert summary to data.frame
- How can I prevent rbind() from geting really slow as dataframe grows larger?
- Unlist a data frame by rows, not columns
- Deleting columns from a data.frame where NA is more than 15% of the column length [duplicate]
- Using lapply to apply a function over list of data frames and saving output to files with different names
- DT[!(x == .)] and DT[x != .] treat NA in x inconsistently
- Return df with a columns values that occur more than once [duplicate]
- Row-wise sum of values grouped by columns with same name
- Replicate each row of data.frame and specify the number of replications for each row?
- R how can I calculate difference between rows in a data frame