From 674493e344aec0e48f2c4dd0255e034df4a02400 Mon Sep 17 00:00:00 2001 From: avahoffman Date: Thu, 11 Jun 2026 11:15:02 -0400 Subject: [PATCH 1/2] Format table / cleanup --- modules/Data_Classes/Data_Classes.Rmd | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/Data_Classes/Data_Classes.Rmd b/modules/Data_Classes/Data_Classes.Rmd index d0316a37..835de134 100644 --- a/modules/Data_Classes/Data_Classes.Rmd +++ b/modules/Data_Classes/Data_Classes.Rmd @@ -135,17 +135,17 @@ Examples: - Strongly Agree, Agree, Neutral, Disagree, Strongly Disagree - beginner, novice, intermediate, expert -** We will learn more about factors in a later module. ** +We will learn more about factors in a later module. ## Classes Overview -| Example | Class | Type | Notes | -|:---:|:---:|:---:|---| -| 1.1 | Numeric | double | default for numbers | -| 1 | integer | integer | Need to coerce to integer with as.integer() or use sample() or seq() with whole numbers | -| "FALSE", "Ball" | Character | Character | Need quotes | -| FALSE, TRUE | logical | logical | No quotes | -| "Small", "Large" | Factor | Factor | Need to coerce to factor with factor() | +| Example | Class | Type | Notes | +|-:-:--------------|-:-:-------|-:-:-------|-----------------------------------------------------------------------------------------| +| 1.1 | numeric | double | Default for numbers | +| 1 | integer | integer | Need to coerce to integer with as.integer() or use sample()/seq() with whole numbers | +| "FALSE", "Ball" | character | character | Need quotes | +| FALSE, TRUE | logical | logical | No quotes, 0 and 1, respectively | +| "Small", "Large" | factor | factor | Need to coerce to factor with factor() | # Special data classes From d32e3760a3c3c0ed2337da3686fb6a20b228a7b5 Mon Sep 17 00:00:00 2001 From: avahoffman Date: Thu, 11 Jun 2026 11:29:14 -0400 Subject: [PATCH 2/2] A little formatting of the table and cleaning things up --- modules/Data_Classes/Data_Classes.Rmd | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/Data_Classes/Data_Classes.Rmd b/modules/Data_Classes/Data_Classes.Rmd index 835de134..2d55aead 100644 --- a/modules/Data_Classes/Data_Classes.Rmd +++ b/modules/Data_Classes/Data_Classes.Rmd @@ -135,17 +135,17 @@ Examples: - Strongly Agree, Agree, Neutral, Disagree, Strongly Disagree - beginner, novice, intermediate, expert -We will learn more about factors in a later module. +** We will learn more about factors in a later module. ** ## Classes Overview -| Example | Class | Type | Notes | -|-:-:--------------|-:-:-------|-:-:-------|-----------------------------------------------------------------------------------------| -| 1.1 | numeric | double | Default for numbers | -| 1 | integer | integer | Need to coerce to integer with as.integer() or use sample()/seq() with whole numbers | -| "FALSE", "Ball" | character | character | Need quotes | -| FALSE, TRUE | logical | logical | No quotes, 0 and 1, respectively | -| "Small", "Large" | factor | factor | Need to coerce to factor with factor() | +| Example | Class | Type | Notes | +|:----------------:|:---------:|:---------:|----------------------------------------------------------------------------------------------------| +| 1.1 | numeric | double | Default for numbers | +| 1 | integer | integer | Need to coerce to integer with `as.integer()` or use `sample()` or `seq()` to create whole numbers | +| "FALSE", "Ball" | character | character | Need quotes | +| FALSE, TRUE | logical | logical | No quotes, 0 and 1, respectively | +| "Small", "Large" | factor | factor | Need to coerce to factor with `factor()` | # Special data classes @@ -153,19 +153,19 @@ Examples: There are two most popular R classes used when working with dates and times: -- `Date` class representing a calendar date -- `POSIXct` class representing a calendar date with hours, minutes, seconds +- `Date` class - a calendar date +- `POSIXct` class - a calendar date with hours, minutes, seconds -We convert data from character to `Date`/`POSIXct` to use functions to manipulate date/date and time +Converting data from character to `Date`/`POSIXct` allows special functions date/date and time -`lubridate` is a powerful, widely used R package from "tidyverse" family to work with `Date` / `POSIXct` class objects +`lubridate` (part of `tidyverse`) helps work with `Date` / `POSIXct` class objects ## Creating `Date` class object ```{r, message = FALSE} class("2021-06-15") -library(lubridate) +library(tidyverse) # Contains lubridate x <- ymd("2021-06-15") # lubridate package Year Month Day class(x)