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
• 42,430 points
35 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
• 42,430 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,040 points
119 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,690 points
27 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,440 points
46 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 in Data Analytics by Chandu
50 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
116 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
160 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
87 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
104 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
• 42,430 points
49 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
• 42,430 points
27 views