Which command is Opposite of %in% ?

0 votes
May 28, 2018 in Data Analytics by shams
• 3,630 points
74 views

1 answer to this question.

0 votes

We can use the ! operator inorder to make any TRUE FALSE or FALSE TRUE.
So consider a condition where, a categorical variable V1 in a data frame n can have values represented by the letters from A to Z. I want to create a subset m, which excludes some values, say, C, N and P.
m = subset(n, !(V1 %in% c('C','N',P'))) // opposite of %in%

answered May 28, 2018 by zombie
• 3,750 points

Related Questions In Data Analytics

+1 vote
1 answer

How to find out which version of R is loaded

You can use sessionInfo() to accomplish that. > sessionInfo() R version ...READ MORE

answered Nov 8, 2018 in Data Analytics by Maverick
• 10,820 points
90 views
0 votes
3 answers

R vs MATLAB, which is better with respect to machine learning?

Hello, Both are a good programming language you ...READ MORE

answered Apr 12, 2019 in Data Analytics by SA
• 1,050 points
309 views
0 votes
1 answer
0 votes
1 answer

How to drop rows of Pandas DataFrame whose value in certain coulmns is NaN

Hi@DataKing99, You can create one function according to ...READ MORE

answered May 7, 2018 in Data Analytics by DeepCoder786
• 1,720 points

edited Jun 9 by MD 865 views
+1 vote
2 answers

Locating row index of a column which has the maximum value - R

Hi, Nirvana You can also try this. which(iris$Sepal.Length == ...READ MORE

answered Aug 21, 2019 in Data Analytics by anonymous
• 32,490 points
6,259 views
+1 vote
1 answer

Binding rows of 2 data-frames which have non-identical columns

You can use the smartbind() function from ...READ MORE

answered May 21, 2018 in Data Analytics by Bharani
• 4,580 points
3,524 views
0 votes
1 answer

How to write a custom function which will replace all the missing values in a vector with the mean of values in R?

Consider this vector: a<-c(1,2,3,NA,4,5,NA,NA) Write the function to impute ...READ MORE

answered Jul 4, 2018 in Data Analytics by CodingByHeart77
• 3,720 points
1,153 views
+10 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
210 views
0 votes
1 answer

How to find out the package version which is loaded in R?

You can use sessionInfo() to accomplish that. > ...READ MORE

answered Apr 18, 2018 in Data Analytics by zombie
• 3,750 points
86 views
0 votes
1 answer

R language has several packages for solving a problem. How do you make a decision on which one is the best to use?

CRAN package ecosystem has more than 6000 ...READ MORE

answered Jun 4, 2018 in Data Analytics by zombie
• 3,750 points
168 views