#' Recode old SAT (2400 scale) to new SAT (1600 scale)
#'
#' Function to recode old SAT (2400 scale) to new SAT (1600 Scale).
#' Missing and unmatched values are coded as missing.
#'
#' @param x numeric vector of old SAT values on 2400 scale
#' @return integer vector of new SAT values on 1600 scale
#' @examples
#' require(dplyr)
#'
#' old_sat_vals <- round(sample(600:2400, 10), -1)
#' new_sat_vals <- old_sat_to_new_sat_2400(old_sat_vals)
#' old_new_vals <- data.frame(old_sat_vals, new_sat_vals)
#' print(old_new_vals)
#'
#' old_new_vals %>%
#' mutate(new_sat_vals_piped = old_sat_to_new_sat_2400(old_sat_vals))
#' @export
old_sat_to_new_sat_2400 <- function(x){
dplyr::recode(x,
`600` = 400L,
`610` = 410L,
`620` = 420L,
`630` = 430L,
`640` = 440L,
`650` = 450L,
`660` = 460L,
`670` = 470L,
`680` = 480L,
`690` = 490L,
`700` = 500L,
`710` = 510L,
`720` = 520L,
`730` = 530L,
`740` = 540L,
`750` = 550L,
`760` = 560L,
`770` = 580L,
`780` = 590L,
`790` = 600L,
`800` = 610L,
`810` = 620L,
`820` = 630L,
`830` = 640L,
`840` = 650L,
`850` = 660L,
`860` = 670L,
`870` = 680L,
`880` = 690L,
`890` = 690L,
`900` = 700L,
`910` = 710L,
`920` = 710L,
`930` = 720L,
`940` = 730L,
`950` = 730L,
`960` = 740L,
`970` = 740L,
`980` = 750L,
`990` = 760L,
`1000` = 760L,
`1010` = 770L,
`1020` = 780L,
`1030` = 780L,
`1040` = 790L,
`1050` = 800L,
`1060` = 800L,
`1070` = 810L,
`1080` = 810L,
`1090` = 820L,
`1100` = 830L,
`1110` = 830L,
`1120` = 840L,
`1130` = 850L,
`1140` = 850L,
`1150` = 860L,
`1160` = 870L,
`1170` = 870L,
`1180` = 880L,
`1190` = 890L,
`1200` = 890L,
`1210` = 900L,
`1220` = 910L,
`1230` = 910L,
`1240` = 920L,
`1250` = 930L,
`1260` = 930L,
`1270` = 940L,
`1280` = 950L,
`1290` = 950L,
`1300` = 960L,
`1310` = 970L,
`1320` = 980L,
`1330` = 980L,
`1340` = 990L,
`1350` = 1000L,
`1360` = 1000L,
`1370` = 1010L,
`1380` = 1020L,
`1390` = 1020L,
`1400` = 1030L,
`1410` = 1030L,
`1420` = 1040L,
`1430` = 1050L,
`1440` = 1050L,
`1450` = 1060L,
`1460` = 1070L,
`1470` = 1070L,
`1480` = 1080L,
`1490` = 1090L,
`1500` = 1090L,
`1510` = 1100L,
`1520` = 1110L,
`1530` = 1110L,
`1540` = 1120L,
`1550` = 1120L,
`1560` = 1130L,
`1570` = 1140L,
`1580` = 1140L,
`1590` = 1150L,
`1600` = 1160L,
`1610` = 1160L,
`1620` = 1170L,
`1630` = 1180L,
`1640` = 1180L,
`1650` = 1190L,
`1660` = 1200L,
`1670` = 1200L,
`1680` = 1210L,
`1690` = 1210L,
`1700` = 1220L,
`1710` = 1230L,
`1720` = 1230L,
`1730` = 1240L,
`1740` = 1250L,
`1750` = 1250L,
`1760` = 1260L,
`1770` = 1270L,
`1780` = 1270L,
`1790` = 1280L,
`1800` = 1290L,
`1810` = 1290L,
`1820` = 1300L,
`1830` = 1300L,
`1840` = 1310L,
`1850` = 1320L,
`1860` = 1320L,
`1870` = 1330L,
`1880` = 1340L,
`1890` = 1340L,
`1900` = 1350L,
`1910` = 1350L,
`1920` = 1360L,
`1930` = 1370L,
`1940` = 1370L,
`1950` = 1380L,
`1960` = 1380L,
`1970` = 1390L,
`1980` = 1400L,
`1990` = 1400L,
`2000` = 1410L,
`2010` = 1410L,
`2020` = 1420L,
`2030` = 1430L,
`2040` = 1430L,
`2050` = 1440L,
`2060` = 1440L,
`2070` = 1450L,
`2080` = 1450L,
`2090` = 1460L,
`2100` = 1470L,
`2110` = 1470L,
`2120` = 1480L,
`2130` = 1480L,
`2140` = 1490L,
`2150` = 1490L,
`2160` = 1500L,
`2170` = 1500L,
`2180` = 1510L,
`2190` = 1510L,
`2200` = 1510L,
`2210` = 1520L,
`2220` = 1520L,
`2230` = 1530L,
`2240` = 1530L,
`2250` = 1540L,
`2260` = 1540L,
`2270` = 1550L,
`2280` = 1550L,
`2290` = 1550L,
`2300` = 1560L,
`2310` = 1560L,
`2320` = 1570L,
`2330` = 1570L,
`2340` = 1580L,
`2350` = 1580L,
`2360` = 1590L,
`2370` = 1590L,
`2380` = 1590L,
`2390` = 1600L,
`2400` = 1600L,
.default = NA_integer_)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.