Created
November 2, 2012 18:17
-
-
Save tlamadon/4003330 to your computer and use it in GitHub Desktop.
change names in a table
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new_names = list( | |
e2u_p='E2U', | |
j2j_p='J2J', | |
u_p ='U', | |
u2e_p='U2E', | |
'dlw_dlw_ee' = '$\\mbox{Cov}( \\Delta log(w_t) , \\Delta log(w_{t-1})|EE)$', | |
'dlw_ee_m' = '$E( \\Delta log(w_t) | EE)$', | |
'dlw_ee_v' = '$\\mbox{Var}( \\Delta log(w_t) | EE)$', | |
'dlw_j2j_v' = '$\\mbox{Var}( \\Delta log(w_t) | J2J)$', | |
'dlw_j2j_m' = '$E( \\Delta log(w_t) | J2J)$', | |
'lw_v' = '$\\mbox{Var}(log(w_t | J2J)$', | |
'dlw_dlcw_ee_c' = "$\\mbox{Cov}( \\Delta log(w_{jt}), \\Delta log(w_{j't}) | J2J)$", | |
'lw_lcw_ee_c' = "$\\mbox{Cov}( log(w_{jt}), log(w_{j't}) | J2J)$" | |
) | |
rf <- function(x) { ifelse( paste(x) %in% names(new_names), new_names[paste(x)] , paste(x)) } | |
dd.m$variable = unlist(sapply( dd.m$variable, rf)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment