timeuse_format: Cleans and formats data from the Time Use campaign.

timeuse_formatR Documentation

Cleans and formats data from the Time Use campaign.

Description

Cleans and formats data from the Time Use campaign. Each observation will be the average time spent participating in various activities over the data collection period for each user.

Usage

timeuse_format(data)

Arguments

data

Data frame. The unaltered Time Use campaign data that is downloaded, uploaded and loaded from the Mobilize landing page.

Value

The average time spent participating in various activities for each participant.

How it works

The code cleans and aggregates the data in a 3-step process.

  1. The first step is to do some preliminary cleaning of the data. This includes a step to turn "NOT_DISPLAYED" values into 0's. This is done because when a user does not select a category to note the amount of time they've participated, it's assumed that the reason is because they've participated in the activity for 0 minutes.

  2. The next step is to sum the amount of time spent doing the various activities for each day. This then represents the total amount of time spent performing the various activities over the course of each day.

  3. Finally, the third step is to take the summed times for each day from step 2. and average them over the total number of days they participated in the campaign.

Examples

## Not run: 
timeuse_raw <- read.csv("My class time use data.csv")
timeuse <- timeuse_format(timeuse_raw)

## End(Not run)


mobilizingcs/mobilizr documentation built on Feb. 17, 2024, 7:49 p.m.