View source: R/dataframe_tools.R
| collapse_df | R Documentation | 
Useful for taking every number in a table and plotting it in a histogram, for example.
collapse_df(df, from = 1, to = NULL, cols = NULL)
df | 
 (Dataframe) A dataframe.  | 
from, to | 
 (Numeric or   | 
cols | 
 (Numeric or   | 
A vector containing the cell contents from the selected columns of df.
If all of the cells are numeric, the vector is Numeric. If any of the cells contain
strings, the vector is Character. The columns are concatenated in order.
Desi Quintans (http://www.desiquintans.com)
collapse_df(iris, cols = 1:4)
#> [1] 5.1 4.9 4.7 4.6 5.0 5.4 4.6 5.0 4.4 4.9 5.4 4.8 ...
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.