Which command is Opposite of %in% ?

0 votes
May 28, 2018 in Data Analytics by shams
• 3,580 points
12 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,690 points

Related Questions In Data Analytics

0 votes
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,040 points
16 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 in Data Analytics by SA
• 1,030 points
69 views
0 votes
1 answer
0 votes
1 answer

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

Easy Way: This Way we can easily handle ...READ MORE

answered May 7, 2018 in Data Analytics by DeepCoder786
• 1,700 points
599 views
0 votes
1 answer

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

which.max(iris$Sepal.Length) This command will give you the desired ...READ MORE

answered May 16, 2018 in Data Analytics by Bharani
• 4,550 points
59 views
0 votes
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,550 points
171 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,680 points
91 views
0 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 ANMOL
• 3,620 points
43 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,690 points
21 views
0 votes
1 answer