What tilde command do

0 votes

I saw in a tutorial about regression modeling the following command :

myFormula <- Species ~ Sepal.Length + Sepal.Width + Petal.Length + Petal.Width

What exactly does this command do, and what is the role of ~ (tilde) in the command?

Oct 30, 2018 in Data Analytics by Ali
• 11,360 points
2,373 views

1 answer to this question.

0 votes

Something that characterizes formulas in R is the tilde operator ~. With this operator, you can actually say: "capture the meaning of this code, without evaluating it right away”. That also explains why you can think of a formula in R as a "quoting" operator.

But what does a formula exactly look like? Take a closer look at the following line of code:

# A formula
c <- y ~ x
d <- y ~ x + b
# Double check the class of `c`
class(c)

'formula'

The variable on the left-hand side of a tilde (~) is called the "dependent variable", while the variables on the right-hand side are called the "independent variables" and are joined by plus signs +.

answered Oct 30, 2018 by Maverick
• 10,840 points

Related Questions In Data Analytics

0 votes
1 answer

How do I find out what directory R has chosen to store packages?

.libPaths() // You can use this command ...READ MORE

answered Apr 24, 2018 in Data Analytics by zombie
• 3,790 points
388 views
0 votes
1 answer

What do you understand by statistical power of sensitivity and how do you calculate it?

Sensitivity is commonly used to validate the ...READ MORE

answered Aug 20, 2018 in Data Analytics by Abhi
• 3,720 points
742 views
0 votes
1 answer

What does the sink function do in R?

sink diverts R output to a connection ...READ MORE

answered May 24, 2019 in Data Analytics by Chandu
941 views
0 votes
2 answers

What is difference between Distributed search head and Search head cluster?

 A distributed environment describes the separation of ...READ MORE

answered Dec 4, 2018 in Data Analytics by Ali
• 11,360 points
2,038 views
0 votes
1 answer

By using dpylr package sum of multiple columns

Basically here we are making an equation ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
1,994 views
0 votes
1 answer

How to convert a text mining termDocumentMatrix into excel or csv in R?

By assuming that all the values are ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
1,605 views
0 votes
1 answer

In a dpylr pipline how to use sample and seq?

For avoiding rowwise(), I prefer to use ...READ MORE

answered Apr 6, 2018 in Data Analytics by DeepCoder786
• 1,720 points

edited Jun 9, 2020 by Gitika 892 views
0 votes
1 answer

How to create a list of Data frames?

Basically all we have to do is ...READ MORE

answered Apr 9, 2018 in Data Analytics by DeepCoder786
• 1,720 points
997 views
0 votes
1 answer

What do you mean by technically correct data in data science?

we define technically correct data as a ...READ MORE

answered Nov 14, 2018 in Data Analytics by Maverick
• 10,840 points
648 views
0 votes
1 answer

What are R packages

These are a few R packages available: tidyverse Shiny rma ...READ MORE

answered Oct 26, 2018 in Data Analytics by Maverick
• 10,840 points
413 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP