Dates and Time + Tables Flashcards

1
Q

Dates and Time Data

A
  • Have traits of both character and numeric data.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

as.Date()

A
  • Function that converts character representations of dates (without times).
  • Best used with dates that appear without times.
  • Can allow for a variety of input formats using the format = argument.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

strptime()

A
  • Function that converts character representations of dates and times to Unix (POSIX).
  • Used when data has times, time zones, AM/PM time stamps, etc.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Lubridate

A
  • Package that makes character representations of dates / times easy to convert.
  • Handles the computation of intervals easily.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Beginning Data in R

A
  • Almost all dates are stored by R as the number of days or seconds from January 1, 1970.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

unclass(argument)

A
  • Function in R that can be used to reveal R’s storage of the date.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Formatting of Dates in R

A
  • R expects the format of YYYY-MM-DD or YYYY/MM/DD.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Format Options for as.Date()

A

1) %B: full month spelled out.
2) %b: abbreviated month spelled out
2) %d: day 1-31.
3) %y: 2 digit year.
4) %Y: 4 digit year.
4) %h: hour in 24 hours.
5) %S: seconds.
6) %I: 12 hour clock.
7) %M: minutes.
8) %p: AM/PM.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

weekdays(), months(), quarters()

A
  • Base R functions that can be used.

- Return character vectors.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

hours(), minutes()

A
  • Functions in lubridate which can be useful for variables with time stamps.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

table(vector_argument)

A
  • Function that create the simplest table.
  • Generates a one-way table.
  • Can utilize the option levels = to name the columns.
  • For example,
    offcampus$RDOW
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

table(argument1,argument2)

A
  • Function that creates a simple two way table.
  • argument1 is for the row variable.
  • argument2 is for the column variable.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

prop.table(argument)

A
  • Function that tells R to display proportions for tables.
  • Argument requires a table to serve as data.
  • All the number sin the table will cum to one.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly