Skip to content

Vector addition incorrect information #16

@mkfreeman

Description

@mkfreeman

In 7.7.1 it (incorrectly) states that one is "unable to change the number of elements in a vector". However, elements can be added to a vector with this syntax:

# More commonly used syntax
a <- c(1,2,3)
a <- c(a, 4)

# Doesn't throw an error
a <- c(1,2,3)
a[4] <- 4

Should be clear why the common syntax is more common (i.e., no need to know the current number of elements).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions