Hello!
I want to rename non-numeric values Web-Mobile, Web, App, STB in column "device" to web-mobile, desktop, mobile, connected_tv. Script is below:
SVOD_TVOD <-
read.csv('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\SVOD_TVOD.csv', sep = ";", encoding = 'UTF-8') %>%
dplyr::select(Дата, g_campaign, X.U.FEFF.g_source, Measure.Names, Платформа, Measure.Values) %>%
dplyr::rename(date = Дата
, campaign = g_campaign
, sourceMedium = X.U.FEFF.g_source
,
measure_names = Measure.Names
, measure_values = Measure.Values
, device = Платформа
) %>%
mutate(date = as.Date(date, format="%d.%m.%Y", tryFormats = c("%d.%m.%Y", "%Y/%m/%d")),
sourceMedium_v1 = paste(sourceMedium, " / cpc", sep = "")) %>%
case_when(SVOD_TVOD %in% "Web" == "desktop")
Can i use function "case_when"?
I guess that i have a mistake in fuction "case_when" , but i don`t understand where.