Visual Glossary of Terms
Datetime:
- stores a calendar date and time
time <- as.POSIXct(
"2026-09-23 14:30:00"
)
time
## [1] "2026-09-23 14:30:00 EDT"
class(time)
## [1] "POSIXct" "POSIXt"
Character:
cormorant <- "Phalacrocoracidae"
cormorant
## [1] "Phalacrocoracidae"
class(cormorant)
## [1] "character"
Numeric:
- store numbers to be used in mathematical calculations
age <- 23
age
## [1] 23
class(age)
## [1] "numeric"
Boolean
- In R, logical. This gives a true/false output.
gene_count <- 150
gene_count > 100
## [1] TRUE
high_expression <- gene_count > 100
high_expression
## [1] TRUE
class(high_expression)
## [1] "logical"
Array:
- Stores data of the same type in multiple dimensions, with rows and
columns, etc.
gene_array <- array(
1:12,
dim = c(3, 2, 2)
)
gene_array
## , , 1
##
## [,1] [,2]
## [1,] 1 4
## [2,] 2 5
## [3,] 3 6
##
## , , 2
##
## [,1] [,2]
## [1,] 7 10
## [2,] 8 11
## [3,] 9 12
Vector:
- Stores multiple values og the same type in a sequence
gene_counts <- c(100, 150, 125, 175)
gene_counts
## [1] 100 150 125 175
class(gene_counts)
## [1] "numeric"
length(gene_counts)
## [1] 4
Dataframe:
- Organizes data with observations in rows and variables in columns.
Can include different types of data.
gene_data <- data.frame(
gene = c("GeneA", "GeneB", "GeneC"),
expression = c(100, 150, 125),
expressed = c(TRUE, TRUE, FALSE)
)
gene_data
## gene expression expressed
## 1 GeneA 100 TRUE
## 2 GeneB 150 TRUE
## 3 GeneC 125 FALSE
class(gene_data)
## [1] "data.frame"
List:
- A flexible type od R data structure where elements dont need to have
the same type of structure.
experiment <- list(
organism = "Yeast",
counts = c(100, 150, 125),
successful = TRUE
)
experiment
## $organism
## [1] "Yeast"
##
## $counts
## [1] 100 150 125
##
## $successful
## [1] TRUE
class(experiment)
## [1] "list"
Tibble:
- A type of dataframe used by tidyverse with less interference and
stricter rules to avoid altering data and allow one to catch errors
early.
library(tibble)
gene_tibble <- tibble(
gene = c("GeneA", "GeneB", "GeneC"),
expression = c(100, 150, 125),
expressed = c(TRUE, TRUE, FALSE)
)
gene_tibble
## # A tibble: 3 × 3
## gene expression expressed
## <chr> <dbl> <lgl>
## 1 GeneA 100 TRUE
## 2 GeneB 150 TRUE
## 3 GeneC 125 FALSE