mpathsenser 1.2.2
Major changes
mpathsenser now supports the new data format as of m-Path Sense 4.2.6. This comes with a large number of changes. Most importantly, this means that import() had to be updated to handle the new data format. Both the old and new data format are now supported by this package. With the new data format there are some changes to the database.
First, some fields have been removed:
- The
x,y, andzfields fromAccelerometerhave been removed fromimport()and all subsequent functions. These fields were only used when m-Path Sense still collected continuous data, and for some time now only summary data is collected. No continuous data has ever been collected outside of pilot testing, and hence these fields have been removed. - The
x_mean,y_mean,z_mean,x_mean_sq,y_mean_sq,z_mean_sq, andnfields fromGyroscopehave been removed as m-Path Sense will currently collect continuous data. These fields were implemented in anticipation of this change but instead, for now, gyroscopic information has been removed from the app altogether. Thus, these fields are removed from simplicity and clarity. - The
timezonefield has been removed from all sensor tables. This field was once added in m-Path Sense but this never made it to the final version. It has been removed from the database and all subsequent functions.
Second, some fields have been added:
- The
Accelerometerhas gained many new data fields:end_timeis the time at which the sample of the data ended, wheretimedenotes the start time.n, the number of samples, was already present but has been moved in the ordering of the fields.x_mean,y_mean, andz_meanare the mean values of the accelerometer data. These were already present in the data and remain unchanged.x_median,y_median, andz_medianare the median values of the accelerometer data.x_std,y_std, andz_stdare the standard deviations of the accelerometer data.x_aad,y_aad, andz_aadare the average absolute deviations of the accelerometer data.x_min,y_min, andz_minare the minimum values of the accelerometer data.x_max,y_max, andz_maxare the maximum values of the accelerometer data.x_max_min_diff,y_max_min_diff, andz_max_min_diffare the differences between the maximum and minimum values of the accelerometer data.x_mad,y_mad, andz_madare the median absolute deviations of the accelerometer data.x_iqr,y_iqr, andz_iqrare the interquartile ranges of the accelerometer data.x_neg_n,y_neg_n, andz_neg_nare the number of negative values of the accelerometer data.x_pos_n,y_pos_n, andz_pos_nare the number of positive values of the accelerometer data.x_above_mean,y_above_mean, andz_above_meanare the number of values above the mean of the accelerometer data.x_energy,y_energy, andz_energyare similar tox_mean_sq,y_mean_sq, andz_mean_sq, being the average sum of squares.avg_res_accis the average resultant acceleration, being average of the square roots of the values in each of the three axis squared and added together.smais the signal magnitude area, being the sum of absolute values of the three axis averaged over a window.
- The
AppUsagetable has gained 2 new fields:end_timeis the time at which the sample of the data ended, wheretimedenotes the start time. Note that this timestamp may vary slightly from theendfield in the data.package_nameis the full application package name.last_foregroundis the time at which the application was last in the foreground. If the app had not yet been in the foreground, this isNA.
- The
Bluetoothtable has gained 2 new fields:start_scanis the time at which the scan started.end_scanis the time at which the scan ended.
- The
Devicetable has gained 2 new fields:operating_system_versionis the version of the operating system.sdkis the version of the Android SDK or the iOS kernel.
- A new sensor
Heartbeathas been added to the data. This table has the following fields:measurement_id,participant_id,date, andtimelike every other sensor.perioddenotes the time period over which the a heartbeat should be registered, in minutes.device_typedenotes the type of device of this heartbeat.device_role_nameis the role name of the device in the protocol.
- The
Lighttable has gained 1 new field:end_timeis the time at which the sample of the data ended, wheretimedenotes the start time.
Locationhas gained 3 new fields:vertical_accuracyis the estimated vertical accuracy of this location, in meters.heading_accuracyis the estimated bearing accuracy of this location, in degrees. Only available on Android.is_mockis a boolean indicating whether this location was mocked or not. AlwaysFALSEon iOS. Moreover, because SQLite does not support booleans, this is stored as an integer.
- The
Noisetable has gained 1 new field:end_timeis the time at which the sample of the data ended, wheretimedenotes the start time.
Timezonehas been added a separate sensor. This table has the following fields:measurement_id,participant_id,date, andtimelike every other sensor.timezoneis the time zone of the device at the time of the measurement.
Data collected with previous version of m-Path Sense (henceforth referred to as legacy data) can still be read by import() and subsequent functions, but all new fields will have missing values.
Minor changes
mpathsenser::sensorsnow holds 27 sensors, being updated withHeartbeatandTimezone- Added the correct citation for this package.
- Coverage plots with absolute numbers
coverage(relative = FALSE)now show correct colours. The colours are now based on the relative values within each sensor, such that the highest sample is fully red and zero being fully blue. vacuum_db()is a newly exported function within this package. Once called upon a database, it shrinks the database to its minimal size by cleaning up remnants fromimport().- The
maggrittrpackage has been dropped as a dependency, favouringR's native pipe|>over themaggrittrpipe%>%. - Added a vignette 'Data overview' to clarify which fields are available in the database and what they mean.
- Added a
formatargument togeocode_rev()to allow for different output formats from Nominatim's API. geocode_rev()andapp_category()now returnNAif the client or API is offline, as per CRAN guidelines.
Bugfixes
- Fixed an issue in
fix_jsons()where files with illegal ASCII characters could be not fixed because the file was still locked from reading. - A new case has been added to
fix_jsons()where JSON files could incorrectly end with}},followed by a closing bracket]on a new line. This trailing comma is now removed byfix_jsons(). - If
recursive = TRUEinunzip_data()andto = NULL, the output path of the JSON files will be the local directories through which the recursive path is traversed rather than the main directory. - Replaced double quotation marks with single quotation marks in the description, per CRAN guidelines.
Full Changelog: 1.2.2...1.2.2