Learn R Programming

postGIStools (version 0.2.4)

new_hstore: Create a empty hstore

Description

This function creates an empty list of lists, which can be appended to a data frame as a hstore column.

Usage

new_hstore(nr)

Arguments

nr

Number of records.

Value

A empty hstore (list of lists) of length nr.

See Also

%->% to read or edit the resulting data structure.

Examples

Run this code
# NOT RUN {
contacts <- data.frame(name = c("Anne", "Bert", "Chris"))
contacts$phone <- new_hstore(3)
contacts$phone %->% "home" <- c("555-123-4567", "555-923-9134", "555-276-1123")
contacts$phone[2] %->% "cell" <- "555-889-9134"
str(contacts)

# }

Run the code above in your browser using DataLab