R Error: $-Operator is Invalid for Atomic Vectors (Example) | How to Fix | is.atomic & is.recursive
HTML-код
- Опубликовано: 11 сен 2024
- How to fix the error message “$ operator is invalid for atomic vectors” in the R programming language. More details: statisticsglob...
R code of this video:
vec <- 1:5 # Create named vector
names(vec) <- letters[1:5]
vec # Print named vector
data <- data.frame(as.list(vec)) # Convert named vector to data.frame
data # Print data frame
vec$a # Applying $-operator to data frame
data$a # Applying $-operator to data frame
is.atomic(vec) # Apply is.atomic function to vector
is.recursive(vec) # Apply is.recursive function to vector
is.atomic(data) # Apply is.atomic function to data
is.recursive(data) # Apply is.recursive function to data
Follow me on Social Media:
Facebook - Statistics Globe Page: / statisticsglobecom
Facebook - Group for Discussions & Questions: / statisticsglobe
LinkedIn - Statistics Globe Page: / statisticsglobe
LinkedIn - Group for Discussions & Questions: / 12555223
Twitter: / joachimschork
Music by bensound.com