in Education by
Can someone state the difference between the assignment operators = and <- in R? Is this the only difference in both these operators mentioned in the example below: x <- y <- 6 x = y = 6 x = y <- 6 x <- y = 6 # Error in (x <- y) = 6 : could not find function "<-<-" Select the correct answer from above options Hadoop questions and answers, Hive questions pdf, Hadoop question bank, Hadoop questions and answers pdf, mcq on Hadoop pdf,Hadoop questions and solutions, Hadoop mcq Test , Interview Hadoop questions, Hadoop Questions for Interview, Hadoop MCQ (Multiple Choice Questions),Core Hadoop Questions, Core Hadoop MCQ,core Hadoop interview questions for experienced

1 Answer

0 votes
by
 
Best answer
The operator <- can be used anywhere whereas the operator = can only be used at top level. It will be more clearer when it’s used to set an argument value in function call. You can also use one of the tidy_* functions in the formatR and it will automatically replace = with <-. Ex. library(formatR) tidy_source(text = "x=1:5", arrow = TRUE) ## x <- 1:5 To fix the error of your syntax use prefix notation for assignment. x <- 6 `<-`(x, 6) #same thing y = 6 `=`(y, 6) #also the same thing parser interprets x <- y <- 6 as `<-`(x, `<-`(y, 6)) Our expectation is that x <- y = 6 would then be `<-`(x, `=`(y, 6)) but actually it will result as `=`(`<-`(x, y), 6) This is happening because = is lower precedence than <- Hope this helps.

Related questions

0 votes
    Can someone please tell me a quick way to convert a nested list of data whose length is 100 and each item is a list of ... 100 rows and 10 columns? I am attaching a sample data: 5...
asked Dec 21, 2021 in Education by JackTerrance
0 votes
    Can someone please tell me a quick way to convert a nested list of data whose length is 100 and each item is a list of ... 100 rows and 10 columns? I am attaching a sample data: 5...
asked Oct 31, 2021 in Education by JackTerrance
0 votes
    How can I unload a package without restarting R? I tried library but it doesn't show any options that ... Questions, Core Hadoop MCQ,core Hadoop interview questions for experienced...
asked Oct 30, 2021 in Education by JackTerrance
0 votes
    How to replace the values of NA with zeros in some column and data frame I have? Select the correct ... Questions, Core Hadoop MCQ,core Hadoop interview questions for experienced...
asked Oct 30, 2021 in Education by JackTerrance
0 votes
    What exactly is the difference between groupby("x").count and groupby("x").size in Pandas? Select the ... ,Core Questions, Core Hadoop MCQ,core interview questions for experienced...
asked Oct 31, 2021 in Education by JackTerrance
0 votes
    Can someone explain the basic difference that distinguishes s3n, s3a and s3 in Hadoop? Technically how are ... Questions, Core Hadoop MCQ,core interview questions for experienced...
asked Oct 31, 2021 in Education by JackTerrance
0 votes
    Can someone tell me what is metadata? What is the difference between Internal tables and external tables in ... Questions, Core Hadoop MCQ,core interview questions for experienced...
asked Oct 31, 2021 in Education by JackTerrance
0 votes
    In the hive, partitioning and bucketing a table, both are done on a column. But how exactly are they ... ,Core Questions, Core Hadoop MCQ,core interview questions for experienced...
asked Oct 31, 2021 in Education by JackTerrance
0 votes
0 votes
    Can someone tell me the difference between require() and library() in R? Select the correct answer from ... , Core Hadoop MCQ,core Hadoop interview questions for experienced...
asked Oct 30, 2021 in Education by JackTerrance
0 votes
    Can someone tell me what is the basic difference between HBase and Hadoop? I have done my own research ... and answers pdf, Verbal Reasoning interview questions for beginners...
asked Oct 30, 2021 in Education by JackTerrance
0 votes
    Is there any way or any command which I can use in command prompt to know the version of Hadoop? Also, ... ,Core Questions, Core Hadoop MCQ,core interview questions for experienced...
asked Oct 31, 2021 in Education by JackTerrance
0 votes
    I use the function apply whenever I want to do something map py in R I want to know about the ... questions and answers pdf, Verbal Reasoning interview questions for beginners...
asked Oct 30, 2021 in Education by JackTerrance
...