What is the difference between %% and % in R programming?

0 votes

I've executed the following:

> 5%%2
[1] 1
> 5%2
Error: unexpected input in "5%2" 

Why am I getting an error while using '%'?

Apr 23, 2019 in Data Analytics by Tyrion anex
• 8,370 points
208 views

2 answers to this question.

0 votes

There is no such '%' operator in R programming. The '%%' stands for the logical AND operator.

You can check this by using the following command:

help('%%')
answered Apr 23, 2019 by Sophie may
• 9,940 points
0 votes
HI,

%% returns remainder in case of numeric values else returns logical or. There is no % operator. in R.
answered Aug 26, 2019 by anonymous
• 32,460 points

Related Questions In Data Analytics

0 votes
1 answer
0 votes
1 answer

What is the difference between library () and require () functions in R ?

 library() require() Library () function gives an error message ...READ MORE

answered Sep 5, 2018 in Data Analytics by zombie
• 3,750 points
328 views
0 votes
1 answer

What is the difference between list and vector in R?

The difference are - A list holds different ...READ MORE

answered Oct 28, 2019 in Data Analytics by Cherukuri
• 32,460 points
6,022 views
0 votes
1 answer

What is the difference between merge and bind in R?

Merge function merges an arbitrarily large series ...READ MORE

answered Oct 28, 2019 in Data Analytics by Cherukuri
• 32,460 points
586 views
+9 votes
3 answers

Which is a better initiative to learn data science: Python or R?

Well it truly depends on your requirement, If ...READ MORE

answered Aug 8, 2018 in Data Analytics by Abhi
• 3,680 points
148 views
0 votes
1 answer

Error saying "vector size cannot be NA" when using R with data mining

You can use the removesparseterm function.  Removes sparse ...READ MORE

answered Nov 15, 2018 in Data Analytics by Maverick
• 10,820 points
1,097 views
+1 vote
2 answers
0 votes
1 answer

Trying to find frequent itemsets of a data set using arules package

Try replacing ID <- c("A123","A123","A123","A123","B456","B456","B456") item <- c("bread", "butter", "milk", ...READ MORE

answered Nov 15, 2018 in Data Analytics by Maverick
• 10,820 points
74 views
0 votes
1 answer

R programming: Finding the difference between 2 vectors

Try this function, it worked for me: f ...READ MORE

answered Dec 27, 2018 in Data Analytics by Sophie may
• 9,940 points
77 views
0 votes
1 answer

What is the paradigm of R language?

R provides features of object-oriented and functional programming ...READ MORE

answered Jan 10, 2019 in Data Analytics by Sophie may
• 9,940 points
131 views