R sample Function: The Complete Guide

sample() Function in R with Example

Statisticians usually need to take the dataset samples and then calculate the statistics. Taking a sample is easy with R because of the sample() method, as it is nothing more than a subset of data.  R sample The sample() in R is a built-in function that takes a sample of the specified size from the … Read more

What is String as factor in R

What is String as factor in R

The data frames in R can have different data types. But each column should have the same type of data. To create a data frame in R, use the data.frame() function. A data frame is a table or a two-dimensional array-like structure. By default, R converts character strings to factors while creating data frames directly … Read more

What is dnorm() Function in R

dnorm() Function in R with Example

The dnorm() function gives the density. The pnorm() function gives the distribution function. The qnorm() function gives the quantile function. The rnorm() function generates random deviates. dnorm in R The dnorm() in R is a built-in function that calculates the density function with a mean(μ) and standard deviation(σ) for any value of x, μ, and σ. The … Read more

Variance in R: How to Use var() Function in R

How to Calculate Variance in R using var() Function

The variance is a standard of variability. The variance is calculated by taking the average squared deviations from the mean. The variance shows you the degree of spread in your dataset. The more separated the data, the larger the variance is about the mean. Let’s see the definition of variance. What is Variance The variance … Read more

Standard deviation in R: A Beginner’s Guide

How to Calculate Standard Deviation in R using sd()

To measure the response time spread around the mean, use the standard deviation. We have already seen how to calculate percentile and variance in R programming. We have also seen how to calculate the Mean and Mode in R. Let’s see how to calculate the standard deviation, but before that, let’s understand what SD is. … Read more

How to Use pnorm() Function in R

pnorm() Function in R with Example

The normal distribution in R is categorized as rnorm, dnorm, and pnorm. The rnorm, dnorm, and pnorm functions in R help us calculate the normal density, distribution, and quantile function for a set of values. pnorm in R The pnorm in R is a built-in function that returns the Cumulative Density Function (CDF) value of the … Read more

rnorm: What is rnorm() Function in R

rnorm() Function in R - Generate Random Numbers in R

The normal distribution is the collection of random data from independent sources. We get the bell shape curve by plotting a graph with the variable’s value on the horizontal axis and the values’ count on the vertical axis. The center of the curve represents the mean of the dataset. The normal distributions behave differently in … Read more

sapply: What is sapply() Function in R

R sapply - How to Use sapply() Function in R

The sapply() function works like lapply(), but it tries to interpret the output to the most fundamental data structure possible, either Vector or Matrix. The sapply() is a “wrapper” function for lapply(). The apply() function is bundled with R essential package if installed with Anaconda. The apply() function returns the vector or array by applying a … Read more

How to Use setwd() Function in R

setwd() function in R with Example

The working directory can be your best friend or ruthless adversary. Confusion about the working directory is a great time waster. Whenever you want to perform some advanced action, you need to ensure that you are in the correct directory. Otherwise, it can create an issue for you. getwd in R The getwd in r … Read more