label_schools: Convert School Labels for SFPS

Description Usage Arguments Details Value Author(s) Examples

View source: R/label_schools.R

Description

label_schools creates a vector containing a different label for the schools in SFPS. It can create a numeric ("num"), abbreviation ("abbr"), or long form name ("name").

EX: 8, "AMES", "Acequia Madre Elementary"

Usage

1
2
3
4
label_schools(school,
              to = "abbr",
              from = NA,
              current = TRUE)

Arguments

school

an atomic vector of the schools to be relabeled.

from

The existing form that school is in. You can select from c("num","abbr","name") or leave from = NA and let label_schools guess which form it's in. If from == "name", label_schools will attempt to match school to fragments of the long name.

to

the form of the output. Choose from c("num","abbr","name").

current

if TRUE, label_schools returns the current name of the school, not the one that was listed. Ex: DVMS –> MMS

Details

label_schools uses the data set convtable included in SvenR. The old codes for El Camino Real are coerced to num = 11 or abbr = "ECCS" from 174 and c("ECRA","AFES").

Value

a vector of the relabeled values of school

Author(s)

Sven Halvorson ([email protected])

Examples

1
2
3
4
5
6
7
  data = data.frame(esquela = c("madre elem","Agua Fria", "Gilberto University","Capital", "Capshawdawg"))
  data$newname = label_schools(school = data$esquela, to = "abbr")
  data$newname2 = label_schools(school = data$esquela, to = "name", current = FALSE)
  data$num = label_schools(school = data$newname, to = "num")
  View(data)

  #Bojangles! We did it!

svenhalvorson/SvenR documentation built on June 24, 2018, 9:25 a.m.