plot function in R: How to Plot Graph in R

plot() Function in R with Example

R language comes with a graphics package with a generic function called plot(), which is versatile and can be used to create different types of (X, Y) plots with points and lines. plot function in R The plot in R is a built-in generic method for plotting objects. The plot() isn’t a single defined function … 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

as.Date in R: How to Use as.Date() Function in R

as.Date() Function in R with Example

To get today’s date in R, use the Sys.Date() function. Sys.Date() Output [1] “2021-03-11” To get the current date and time in R, use the date() function. date() Output [1] “Thu Mar 11 16:59:16 2021” Dates can be imported from character, numeric, POSIXlt, and POSIXct formats in R using the as.Date() method. as.Date in R … Read more

rnorm: What is rnorm() Function in R

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

The rnorm() function in R generates a random number using a normal(bell curve) distribution. Thus, the rnorm() function simulates random variates having a specified normal distribution. What is Normal Distribution 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 … Read more in r: How to Use function in R in r - How to Use function in R

When working in a real-time dataset, you won’t get clean data. Real-world data is always filled with missing values. So if you are developing an algorithm that can predict the future values, you first need to clean the existing data, and based on that, you can create a model and feed the data. What is … Read more

R switch: How to use switch() function in r

R Switch - How to Use switch() Function in R

A switch statement enables a variable to be tested for equality against a list of values. The value of the switch() function is called a case, and the variable being switched on is checked for each case. The nested if…else statement in R is exceptionally beneficial when you need to execute a particular code block when the … Read more

Standard deviation in R: How to Use sd() in R

How to Calculate Standard Deviation in R using sd()

We have already seen how to calculate percentile and variance in R programming. We have also seen how to calculate Mean and Mode in R. Let’s see how to compute the standard deviation, but before that, let’s understand what SD is. What is Standard Deviation The standard deviation of a population is the square root of … Read more

cbind in R: How to Bind Data Frame By Columns

cbind in R - How to Bind Data Frame By Columns

The cbind() and rbind() functions are generic methods for data frames. These data frame functions will be used if at least one argument is a data frame and the other are vectors or matrices. To merge two data frames (datasets) horizontally, use the merge() function in the R language. cbind in R The cbind short for column … Read more

dnorm in r: 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 σ. … Read more

How to Use Dollar sign in R

Dollar sign in R with Example

There are four forms of the extract operator in R: [, [[, $, and @. The fourth form is the slot operator and is used to extract content from objects built with the S4 object system, also known as a formally defined object in R. Most beginning R users don’t work with formally defined objects … Read more