Converting several numeric variables to factors in R

preview_player
Показать описание
Shows how to change many numeric variables to categorical variables in R.

R is a free software environment for statistical computing and graphics, and is widely used by both academia and industry. R software works on both Windows and Mac-OS. It was ranked no. 1 in a KDnuggets poll on top languages for analytics, data mining, and data science. RStudio is a user friendly environment for R that has become popular.
Рекомендации по теме
Комментарии
Автор

When it comes to changing only a several set of columns, how to convert it at once? As an example; i want to convert 3 columns to numeric and another 3 columns to factor (In the same data set)?

hashanthifernando
Автор

This techniques seems good but only when in the dataset all the columns are having at the max three levels bcause by putting colClasses=True it changes all columns into factors . The as.factor function helps in a more better way to change specific column to Factors instead of all

uttamdey
Автор

What is a simple way of explaining why we convert numeric variables into factors?
For example a question asking whether you have been a victim of violence 1- yes 2- no

brionyclark
Автор

hello Sir
This technique will work only if we have binary values in the columns. What if we have random numeric values in the column like salary, age, height, stock prices ?
In that case can we do binning first and then convert that column which is binned to factor ?
or is there any better way we can do that ?
Please advice.

inderjeetsinghintech
Автор

what to put in colClasses = if we want to conver all variables in to numeric.

aks
Автор

I have a huge problem with this, as I mostly work with factor data. It does not work. THe R says no method or default for coercing “character” to “Factor”. What to do?

sarazr
Автор

Sir can u please provide a link to download these csv files from github or anywhere else.

uttamdey
Автор

how to change one particular column into factor?

ilovemyindia
Автор

Hello Sir,

I am working with R and got stuck in a character variable which contains time like "04:02:00" & I want to perform logical operations and some calculations with it but unable to find the way.

Please check and help if possible.

Many thanks in advance.

Regards,
Zahid Shaikh (India)

shaikhzahid