Assuming your dataframe is mydf:
mydf$task <- factor(mydf$task, levels = c("up", "down", "left", "right", "front", "back"))
More Related Contents:
- Reshaping data.frame from wide to long format
- How to sum a variable by group
- How do I make a list of data frames?
- Aggregate / summarize multiple variables per group (e.g. sum, mean)
- Dynamically select data frame columns using $ and a character value
- Sort (order) data frame rows by multiple columns
- Simultaneously merge multiple data.frames in a list
- Split data frame string column into multiple columns
- Filter data.frame rows by a logical condition
- Count number of rows within each group
- Quickly reading very large tables as dataframes
- Drop unused factor levels in a subsetted data frame
- Split data.frame based on levels of a factor into new data.frames
- Combine a list of data frames into one data frame by row
- Subset data frame based on number of rows per group
- Combine two data frames by rows (rbind) when they have different sets of columns
- Counting unique / distinct values by group in a data frame
- Pass a data.frame column name to a function
- Drop data frame columns by name
- How to split a data frame?
- Why is it not advisable to use attach() in R, and what should I use instead?
- Create an empty data.frame
- How to plot all the columns of a data frame in R
- Sample random rows in dataframe
- Extracting specific columns from a data frame
- Subset / filter rows in a data frame based on a condition in a column
- How does one reorder columns in a data frame?
- Convert data.frame column format from character to factor
- Combine two or more columns in a dataframe into a new column with a new name
- Dollar sign before a variable