R has something called lazy evaluation, what does that mean?

0 votes
I've just started to learn R and have read about something called lazy evaluation. I dont understand what that means as it does not exist in any other language. Can somebody explain?
Oct 31, 2018 in Data Analytics by Kalgi
• 51,890 points
88 views

1 answer to this question.

0 votes

Let me explain this with an example. Consider the following code, here there are two paramaters passed, a and b. But only a is being used in the function.

F <- function(a,b)
{
                a^2
}

So when we call the function with just one parameter it assumes that one parameter is the value for the variable that is being used. So if we call the function like this, 

F(2)

it assumes 2 to be a's value. Calling the function F with just one parameter doesn’t give any error. 

answered Oct 31, 2018 by Kalgi
• 51,890 points

Related Questions In Data Analytics

0 votes
1 answer

What does the inf special character mean in R?

inf stands for infinity and only applies ...READ MORE

answered Nov 14, 2018 in Data Analytics by Maverick
• 10,820 points
224 views
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 23, 2018 in Data Analytics by zombie
• 3,750 points
59 views
0 votes
1 answer

What does “Error: object '<myvariable>' not found” mean?

The error means that R could not ...READ MORE

answered Oct 29, 2018 in Data Analytics by Ali
• 10,670 points
476 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
175 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
712 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
376 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 by Gitika 156 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
230 views
0 votes
1 answer

What does “replacement has” Error mean?

This error occurs when one tries to ...READ MORE

answered Oct 31, 2018 in Data Analytics by Kalgi
• 51,890 points
81 views
0 votes
1 answer

What are R tools

Rtools provides a toolchain for Windows platform ...READ MORE

answered Oct 26, 2018 in Data Analytics by Kalgi
• 51,890 points
58 views