The README has full details, but here's a brief taster:
Installation
library(devtools)
install_github("hughjonesd/refset")
Creating a refset
library(refset)
employees <- data.frame(
id=1:4,
name=c("James", "Sylvia", "Meng Qi", "Luis"),
age=c(28,44,38, 23),
gender=factor(c("M", "F", "F", "M")),
stringsAsFactors=FALSE)
refset(rs, employees[1:2,])
Refsets refer to the original
rs
## id name age gender
## 1 1 James 28 M
## 2 2 Sylvia 44 F
employees$name[1] <- "Jimmy"
rs
## id name age gender
## 1 1 Jimmy 28 M
## 2 2 Sylvia 44 F
Refsets change the original
rs$age <- c(29, 45) employees$age
## [1] 29 45 38 23
No comments:
Post a Comment