filmov
tv
Create Categories Based On Integer & Numeric Range in R (2 Examples) | Convert Data to Factor Class
Показать описание
R code of this video:
num1 <- c(1, 4, 3, 7, 1, 4, 3, 3, 7) # Create numeric example data
num1 # Print numeric example data
class(num1) # Class of data
cat1 # Print categorical data
class(cat1) # Class of data
num2 <- rnorm(100) # Create numeric example data
head(num2) # Head of numeric example data
cat2 <- numeric() # Create empty data object
cat2[num2 < - 1] <- 1 # Assign categories based on numeric range
cat2[num2 >= - 1 & num2 < 0] <- 2
cat2[num2 >= 0 & num2 < 1] <- 3
cat2[num2 >= 1] <- 4
head(cat2) # Head of categorical data
Follow me on Social Media:
num1 <- c(1, 4, 3, 7, 1, 4, 3, 3, 7) # Create numeric example data
num1 # Print numeric example data
class(num1) # Class of data
cat1 # Print categorical data
class(cat1) # Class of data
num2 <- rnorm(100) # Create numeric example data
head(num2) # Head of numeric example data
cat2 <- numeric() # Create empty data object
cat2[num2 < - 1] <- 1 # Assign categories based on numeric range
cat2[num2 >= - 1 & num2 < 0] <- 2
cat2[num2 >= 0 & num2 < 1] <- 3
cat2[num2 >= 1] <- 4
head(cat2) # Head of categorical data
Follow me on Social Media:
Create Categories Based On Integer & Numeric Range in R (2 Examples) | Convert Data to Factor Cl...
Data management: How to convert categorical string variables to labeled numeric variables
Use Excel 2016 to make Frequency distribution and Histogram for quantitative data
How to Set X and Y Axis in Excel
2.2 Construct frequency table for non-numerical data using Excel
Data management: How to convert a string variable to a numeric variable
Data management: How to label the values of categorical variables
Create Index Column By Group in Power Query
FREE AI Classes: Python for Data Science and Machine Learning
Create a drop down list in Google Sheets
SPSSisFun: Converting Text (string) data to Numeric data
Advanced Aggregate Functions in SQL (GROUP BY, HAVING vs. WHERE)
Beginning Objective-C Data Types: Integer - raywenderlich.com
Phebe Vayanos - Integer optimization for predictive & prescriptive analytics in high stakes doma...
Researchers Use Group Theory to Speed Up Algorithms — Introduction to Groups
Tableau - Parameters
Data Science Based Decisions: Mixed-Integer Programming
Measures vs. calculated columns in DAX and Power BI
Power BI Rank Within a Group Using the RANKX Function #Q&A
Index Match with Multiple Criteria
Excel Sort Column by Numbers in Ascending/Descending Order (2020)
Excel If formula - If CONTAINS formula in Excel - 2 Minute Excel Formula
Adding Integers | How to Add Positive and Negative Integers
Combining Data From Multiple Cells in Excel
Комментарии