Publications by Jim

Remove Rows from the data frame in R

03.06.2022

The post Remove Rows from the data frame in R appeared first on Data Science Tutorials Remove Rows from the data frame in R, To remove rows from a data frame in R using dplyr, use the following basic syntax. Detecting and Dealing with Outliers: First Step – Data Science Tutorials 1. Remove any rows containing NA’s. df %>%  na.omit() 2. Remov...

2632 sym R (1374 sym/13 pcs)

How to Remove Columns from a data frame in R

04.06.2022

The post How to Remove Columns from a data frame in R appeared first on Data Science Tutorials Remove Columns from a data frame, you may occasionally need to remove one or more columns from a data frame. Fortunately, the select() method from the dplyr package makes this simple. Remove Rows from the data frame in R – Data Science Tutorials libra...

2787 sym R (1304 sym/10 pcs)

How to add columns to a data frame in R

05.06.2022

The post How to add columns to a data frame in R appeared first on Data Science Tutorials How to add columns to a data frame in R?, To add one or more columns to a data frame in R, use the mutate() function from the dplyr package. With the following data frame, the following examples demonstrate how to use this syntax in practice. How to add labe...

2353 sym R (2118 sym/8 pcs)

Count Observations by Group in R

06.06.2022

The post Count Observations by Group in R appeared first on Data Science Tutorials Count Observations by Group in R, want to count the number of observations by the group. Fortunately, the count() function from the dplyr library makes this simple. Using the data frame below, this tutorial shows numerous examples of how to utilize this function in...

2155 sym R (727 sym/5 pcs)

How to Count Distinct Values in R

07.06.2022

The post How to Count Distinct Values in R appeared first on Data Science Tutorials How to Count Distinct Values in R?, using the n_distinct() function from dplyr, you can count the number of distinct values in an R data frame using one of the following methods. With the given data frame, the following examples explain how to apply each of these ...

2399 sym R (702 sym/4 pcs)

Cumulative Sum calculation in R

07.06.2022

The post Cumulative Sum calculation in R appeared first on Data Science Tutorials Cumulative Sum calculation in R, using the dplyr package in R, you can calculate the cumulative sum of a column using the following methods. Best online course for R programming – Data Science Tutorials Approach 1: Calculate Cumulative Sum of One Column df %>% mut...

1884 sym R (1255 sym/10 pcs)

droplevels in R with examples

08.06.2022

The post droplevels in R with examples appeared first on Data Science Tutorials droplevels in R with examples, To remove unneeded factor levels, use R’s droplevels() function. This function comes in handy when we need to get rid of factor levels that are no longer in use as a result of subsetting a vector or a data frame. The syntax for this fu...

2908 sym R (608 sym/12 pcs)

Augmented Dickey-Fuller Test in R

10.06.2022

The post Augmented Dickey-Fuller Test in R appeared first on Data Science Tutorials Augmented Dickey-Fuller Test in R, If a time series has no trend, constant variance over time, and a consistent autocorrelation structure across time, it is considered to be “stationary.” An augmented Dickey-Fuller test, which uses the following null and alter...

2394 sym R (245 sym/4 pcs) 2 img

Crosstab calculation in R

11.06.2022

The post Crosstab calculation in R appeared first on Data Science Tutorials Crosstab calculation in R, To create a crosstab using functions from the dplyr and tidyr packages in R, use the following basic syntax. df %>%   group_by(var1, var2) %>%   tally() %>%   spread(var1, n) The examples below demonstrate how to utilize this syntax in practi...

1789 sym R (942 sym/7 pcs)

Filtering for Unique Values in R- Using the dplyr

12.06.2022

The post Filtering for Unique Values in R- Using the dplyr appeared first on Data Science Tutorials Filtering for Unique Values in R, Using the dplyr package in R, you may filter for unique values in a data frame using the following methods. Method 1: In one column, filter for unique values. df %>% distinct(var1) Method 2: Filtering for Unique Va...

2200 sym R (944 sym/11 pcs)