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 in Data Analytics by Tyrion anex
• 8,280 points
86 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 by Sophie may
• 9,870 points
0 votes
HI,

%% returns remainder in case of numeric values else returns logical or. There is no % operator. in R.
answered Aug 26 by anonymous
• 31,840 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,690 points
90 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 in Data Analytics by Cherukuri
• 31,840 points
76 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 in Data Analytics by Cherukuri
• 31,840 points
50 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,040 points
528 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,040 points
45 views
0 votes
1 answer

Error saying "Error in df$item : object of type 'closure' is not subsettable" when trying to use arules package

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

answered Nov 15, 2018 in Data Analytics by Maverick
• 10,040 points
182 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,870 points
47 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 in Data Analytics by Sophie may
• 9,870 points
72 views