Function projects data onto vector from anchor one (score of 0) to anchor two (score of 1). For all three arguments, input must be two-dimensional data frame or matrix with rows = specimens, and columns = PC scores.

calc_vs(data, anchor1, anchor2)

Arguments

data

PC scores of face(s) for which vector scores are to be calculated

anchor1

PC scores of face(s) which will constitute lower anchor point

anchor2

PC scores of face(s) which will constitute upper anchor point

Value

Returns tibble with columns "id" and "VS". If data contained rownames, these will be saved as ids.

Examples

# CALCULATE FEMALE-MALE VECTOR SCORES data("LondonSet_scores") data("LondonSet_info") fem <- LondonSet_scores %>% dplyr::filter(row.names(LondonSet_scores) %in% LondonSet_info$face_id[which(LondonSet_info$face_sex == "female")]) mal <- LondonSet_scores %>% dplyr::filter(row.names(LondonSet_scores) %in% LondonSet_info$face_id[which(LondonSet_info$face_sex == "male")]) calc_vs(LondonSet_scores, fem, mal)
#> # A tibble: 102 x 2 #> id VS #> <chr> <dbl> #> 1 001 -1.06 #> 2 002 0.00299 #> 3 003 -0.250 #> 4 004 0.855 #> 5 005 0.548 #> 6 006 0.582 #> 7 007 -1.16 #> 8 008 1.50 #> 9 009 -1.16 #> 10 010 0.391 #> # … with 92 more rows