У нас вы можете посмотреть бесплатно gsub Function in R - Converting Revenue Data to Numeric или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Revenue data is often tracked with special characters, namely dollar signs and commas. While this is great for visually representing the data, it's not so great when we try to run numeric calculations on that revenue data. You may think we can just use as numeric in r (as.numeric() function), but if the variable you're trying to convert to a number includes those dollar signs and commas, you'll just be left with NA values. In this video, I show the use of the handy gsub() function to remove characters from variables in R. After doing that, we can then run our as.numeric() function as usual and convert our revenue data to a numeric. While this example uses a simple revenue data set, it can be applied across the board, whenever you need to remove characters - even if you don't plan on converting to a numeric value later! Finally, we combined it all into one statement inside of dplyr to help make our R code more compact and more readable.