<- list(c(1, 2), c(1, NA))
x
lapply(x, sum, na.rm = TRUE)
[[1]]
[1] 3
[[2]]
[1] 1
sum(c(1,NA), na.rm = TRUE)
[1] 1
Matthew DeHaven
January 1, 2024
March 31, 2024
[[1]]
[1] 3
[[2]]
[1] 1
[1] 1
T
and F
are shorthands for TRUE
and FALSE
.
List of 2
$ l1:List of 2
..$ name1: int [1:3] 5 6 7
..$ name2: chr [1:3] "A" "D" "E"
$ l2:List of 2
..$ : int [1:5] 1 2 3 4 5
..$ : logi TRUE
[1] "A"
[1] "A"
[1] "A"
List of 2
$ name1: int [1:3] 5 6 7
$ name2: chr [1:3] "A" "D" "E"
List of 1
$ l1:List of 2
..$ name1: int [1:3] 5 6 7
..$ name2: chr [1:3] "A" "D" "E"