Description Usage Arguments Details Value Examples
View source: R/struct2datatable.R
A simple wrapper for readMat for structs that additionally converts the resulting list into a data frame.
1 | struct2dataframe(fn, var = c())
|
fn |
A full (character) filename path pointing to the desired .mat file created by save(). The file must be saved in v6 or before (since R.matlab can't deal with HDF5-like files yet). |
var |
A character variable name, if a specific variable is desired from
the .mat file. If no variable is specified, |
struct2dataframe
is basically just a replacement for a few
lines of code, but saves some time and ensures that the struct you clearly
meant as a data frame for processing or plotting in R actually shows up as
a data frame.
A data frame will be returned with the struct fields as variables and the struct elements as observations
1 | ## Not run: struct2dataframe("~/code/some_struct_v6.mat")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.