Use the model.matrix
function:
model.matrix( ~ Species - 1, data=iris )
More Related Contents:
- Show percent % instead of counts in charts of categorical variables
- Splitting a dataframe string column into multiple different columns [duplicate]
- Embedding Image in Shiny App
- Standardize data columns in R
- using stat_function and facet_wrap together in ggplot2 in R
- Scatter plot with error bars
- Split date into different columns for year, month and day
- How to convert R Markdown to HTML? I.e., What does “Knit HTML” do in Rstudio 0.96?
- Converting geo coordinates from degree to decimal
- Combining Bar and Line chart (double axis) in ggplot2
- Combine column to remove NA’s
- Installing of SparkR
- R Shiny REST API communication
- ggplot – Multiple legends arrangement
- Extract string before “|” [duplicate]
- setting upper and lower limits in rnorm
- R: Convert delimited string into variables
- Add multiple columns to R data.table in one function call?
- Automatically Delete Files/Folders
- if else condition in ggplot to add an extra layer
- What does the function invisible() do?
- How to deal with hdf5 files in R?
- Raw text strings for file paths in R
- Plotting during a loop in RStudio
- R: sample() command subject to a constraint
- R – how to make barplot plot zeros for missing values over the data range?
- Control the size of points in an R scatterplot?
- Different axis limits per facet in ggplot2
- Setting work directory in knitr using opts_chunk$set(root.dir = …) doesn’t work
- Possible to show console messages (written with `message`) in a shiny ui?