Skip to content

Instantly share code, notes, and snippets.

@prasoonsharma
Created November 26, 2010 03:43
Show Gist options
  • Save prasoonsharma/716254 to your computer and use it in GitHub Desktop.
Save prasoonsharma/716254 to your computer and use it in GitHub Desktop.
Atomic data types in R
# ATOMIC DATA TYPES IN R
# Character
first.name <- "Kirk"
# Integer
age <- 25
# Numeric
hourly_wage <- 27.25
# Factor
office <- factor("NYO", levels = c("NYO", "MUM", "SYD"))
# Boolean
married <- TRUE
# OPERATIONS ON ATOMIC TYPES
# Character
last.name <- "Davis"
full.name <- paste(first.name, last.name)
# Integer
time.till.retirement <- 60 - age
# Numeric
weekly.compensation <- 40 * hourly_wage
# Boolean
has.kids <- TRUE
married && has.kids
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment