Convert dataframe to mhealth specification. The column order of converted dataframe would be required_cols, group_cols. Columns that are not specified in the input arguments will be dropped.

mhealth.convert(df, file_type, required_cols, rename_cols = NULL,
  group_cols = NULL, datetime_format = NULL, timezone = "UTC")

Arguments

file_type

mhealth specification file types, see `mhealth$filetype` for all supported types

required_cols

the required columns of file types that are in order. E.g. for annotation, timestamp, start and end time and annotation name columns are required in the order; for sensor, timestamp and necessary numeric columns are required; for feature, timestamp, start and end time and numeric or categoric features are required; for event, timestamp, start and end time and numeric or categoric info columns are required.

rename_cols

rename column names in results as provided string vector (except for the first timestamp column)

group_cols

the columns used for indexing or grouping. Will be converted to numeric or if not, character. Default is null, which means no group columns.

datetime_format

in string. Used to convert tiemstamp and start and stop time columns to date object

timezone

in location string. Used to convert timestamp and start and stop time columns to date object