Read in finite element analysis data
read_mfe_csv.Rd
These are wrappers around readr::read_csv()
and readxl::read_excel()
to
read in and process finite element analysis microCT data from a mfe.csv
file or the MFE
sheet of a data.xlsx
file. It uses a key
object to look
up and add sex, genotype, and site information.
Arguments
- file
The file path to the
mfe.csv
ormfe.xlsx
file.- key
The
key
object containing sample information, as created by theread_key_csv()
orread_key_excel()
function.- ...
Additional arguments passed on to
readr::read_csv()
orreadxl::read_excel()
.- sheet
For
read_mfe_excel()
, the sheet to read. Either a string (the name of a sheet), or an integer (the position of the sheet). Defaults to"MFE"
.
Value
A tibble/data frame containing finite element analysis data. For example:
| AS|Sex |Genotype | SampNo|Site | MeasNo| S| F.ult|
|----:|:---|:--------|------:|:-----|------:|-------:|------:|
| 1365|M |Cre | 10778|Spine | 31711| 11480.0| 32.257|
| 1365|M |Cre | 10778|Met | 31710| 19034.1| 57.483|
| 1365|M |Cre | 10778|Dia | 31712| 25405.7| 79.100|
| 1366|F |Cre | 10779|Spine | 31714| 12449.0| 34.213|
| 1366|F |Cre | 10779|Met | 31713| 20679.9| 62.022|
| 1366|F |Cre | 10779|Dia | 31715| 22832.0| 70.721|
Examples
gen_key <- read_key_csv(mctr_ex("example-gen-key.csv"))
#> Rows: 12 Columns: 7
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> chr (2): Sex, Genotype
#> dbl (5): AS, SampNo, Spine, Met, Dia
#>
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
gen_mfe <- read_mfe_csv(mctr_ex("example-mfe.csv"),
gen_key)
#> Rows: 36 Columns: 47
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> chr (12): SampName, MeasDate, ListDate, Filename, Site, Energy-I-Code, Contr...
#> dbl (30): SampNo, MeasNo, Integr.Time, Sigma, Support, Threshold, Unit, Data...
#> lgl (5): S-DOB, S-Remark, Meas-Rmk, RAW-Label, IMA-Label
#>
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
gen_mfe <- read_mfe_excel(mctr_ex("example-genotype.xlsx"),
gen_key)