#' Recode new SAT (1600 scale) to old SAT (1600 scale)
#'
#' Function to recode new SAT (1600 scale) to old SAT (1600 scale).
#' Missing and unmatched values are coded as missing.
#'
#' @param x numeric vector of new SAT values on 1600 scale
#' @return integer vector of old SAT values on 1600 scale
#' @examples
#' require(dplyr)
#'
#' new_sat_vals <- round(sample(400:1600, 10), -1)
#' old_sat_vals <- new_sat_to_old_sat_1600(new_sat_vals)
#' new_old_vals <- data.frame(new_sat_vals, old_sat_vals)
#' print(new_old_vals)
#'
#' new_old_vals %>%
#' mutate(old_sat_vals_piped = new_sat_to_old_sat_1600(new_sat_vals))
#' @export
new_sat_to_old_sat_1600 <- function(x){
dplyr::recode(x,
`400` = 400L,
`410` = 410L,
`420` = 410L,
`430` = 420L,
`440` = 430L,
`450` = 430L,
`460` = 440L,
`470` = 450L,
`480` = 450L,
`490` = 460L,
`500` = 470L,
`510` = 470L,
`520` = 480L,
`530` = 490L,
`540` = 490L,
`550` = 500L,
`560` = 510L,
`570` = 510L,
`580` = 520L,
`590` = 530L,
`600` = 540L,
`610` = 540L,
`620` = 550L,
`630` = 560L,
`640` = 560L,
`650` = 570L,
`660` = 580L,
`670` = 580L,
`680` = 590L,
`690` = 600L,
`700` = 600L,
`710` = 610L,
`720` = 620L,
`730` = 630L,
`740` = 640L,
`750` = 660L,
`760` = 670L,
`770` = 680L,
`780` = 690L,
`790` = 700L,
`800` = 710L,
`810` = 720L,
`820` = 730L,
`830` = 740L,
`840` = 750L,
`850` = 760L,
`860` = 780L,
`870` = 790L,
`880` = 800L,
`890` = 810L,
`900` = 820L,
`910` = 830L,
`920` = 840L,
`930` = 850L,
`940` = 860L,
`950` = 870L,
`960` = 880L,
`970` = 890L,
`980` = 900L,
`990` = 910L,
`1000` = 920L,
`1010` = 930L,
`1020` = 940L,
`1030` = 950L,
`1040` = 960L,
`1050` = 970L,
`1060` = 980L,
`1070` = 990L,
`1080` = 1000L,
`1090` = 1010L,
`1100` = 1020L,
`1110` = 1030L,
`1120` = 1040L,
`1130` = 1060L,
`1140` = 1070L,
`1150` = 1080L,
`1160` = 1090L,
`1170` = 1100L,
`1180` = 1110L,
`1190` = 1120L,
`1200` = 1130L,
`1210` = 1140L,
`1220` = 1150L,
`1230` = 1160L,
`1240` = 1170L,
`1250` = 1180L,
`1260` = 1190L,
`1270` = 1200L,
`1280` = 1210L,
`1290` = 1220L,
`1300` = 1230L,
`1310` = 1250L,
`1320` = 1260L,
`1330` = 1270L,
`1340` = 1280L,
`1350` = 1290L,
`1360` = 1300L,
`1370` = 1310L,
`1380` = 1320L,
`1390` = 1330L,
`1400` = 1340L,
`1410` = 1350L,
`1420` = 1370L,
`1430` = 1380L,
`1440` = 1390L,
`1450` = 1400L,
`1460` = 1410L,
`1470` = 1420L,
`1480` = 1430L,
`1490` = 1450L,
`1500` = 1460L,
`1510` = 1470L,
`1520` = 1490L,
`1530` = 1500L,
`1540` = 1510L,
`1550` = 1530L,
`1560` = 1540L,
`1570` = 1560L,
`1580` = 1570L,
`1590` = 1580L,
`1600` = 1600L,
.default = NA_integer_)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.