Hi, I am trying to analyse food prices from several countries, Israel is among them. The problem is that data is given in Hebrew and translating it in Excel makes the work a bit clumsy.
Is there a way to translate everything in R using Tokens, or kind of a dictionary, which I already prepared?
Thank you!
Here is part of my data. price is the last original variable and from there, it is my translation.
data <- data.frame(
date = as.Date(c("2015-11-01", "2015-11-01", "2015-11-01", "2015-11-01", "2015-11-01", "2015-11-01", "2015-11-01", "2015-11-01", "2015-11-01", "2015-11-01", "2015-11-01", "2015-11-01", "2015-11-01", "2015-11-01", "2015-11-01", "2015-11-01", "2015-11-01", "2015-11-01")),
id = c(81, 83, 86, 90, 95, 13, 14, 16, 18, 19, 22, 139, 24, 25, 26, 27, 29, 30),
sector_heb = c("הדרים", "הדרים", "הדרים", "הדרים", "הדרים", "ירקות", "ירקות", "ירקות", "ירקות", "ירקות", "ירקות", "ירקות", "ירקות", "ירקות", "ירקות", "ירקות", "ירקות", "ירקות"),
title_heb = c("אשכולית", "לימון", "פומלית", "קליפים (קלמנטינה)", "תפוז", "בטטה", "בטטה", "בצל", "בצל", "בצל", "בצל", "גויבות", "גזר", "גזר", "דלורית", "דלעת", "חסה", "חציל"),
subtitle_heb = c("אדומות", NA, NA, "מיכל", "ולנסיה", NA, NA, "אדום", "בית-אלפא", "יבש", NA, NA, NA, NA, NA, NA, "ערבית", "חממה"),
spec_heb = c(NA, "קוטר 7", NA, NA, NA, NA, NA, NA, "קוטר 45-77", "יבוא", NA, NA, "ארוז", "תפזורת", NA, "10-25 ק\"ג", "יח' 1", NA),
quality_heb = c("סוג א", "סוג א", "סוג א", "סוג א", "סוג א", "סוג א", "מובחר", "סוג א", "סוג א", "סוג א", "סוג א", "סוג א", "סוג א", "סוג א", "סוג א", "סוג א", "סוג א", "סוג א"),
price = c(3.4, 5.1, 3.0, 3.5, 4.9, 2.7, 5.1, 3.0, 2.9, 2.3, 2.5, 7.0, 4.5, 4.0, 2.5, 2.5, 4.0, 3.0),
sector = c("citrus", "citrus", "citrus", "citrus", "citrus", "vegetables", "vegetables", "vegetables", "vegetables", "vegetables", "vegetables", "fruit", "vegetables", "vegetables", "vegetables", "vegetables", "vegetables", "vegetables"),
group = c("grapefruit", "lemon", "grapefruit", "clementine", "orange", "potato", "potato", "onion", "onion", "onion", "onion", "fruit_other", "carrot", "carrot", "cucurbita", "cucurbita", "lettuce", "aubergine"),
title = c("grapefruit", "lemon", "oroblanco", "clementine", "orange", "sweetpotato", "sweetpotato", "onion", "onion", "onion", "onion", "psidium", "carrot", "carrot", "butternut", "pumpkin", "lettuce", "aubergine"),
quality = c("normal", "normal", "normal", "normal", "normal", "normal", "premium", "normal", "normal", "normal", "normal", "normal", "normal", "normal", "normal", "normal", "normal", "normal")
)