简体   繁体   中英

What does this mean? function()!()

What does this mean?

function()!()

which came from

'%!in%' <- function(x,y)!('%in%'(x,y))  #define not in function

https://www.kaggle.com/robhardwick/titanic/my-first-kaggle-script

This function returns a logical vector indicating if the left operand is not a match for any element in the right operand.

%in% is a shortcut for the match function and this function is a further shortcut. Instead of writing

!(a%in%b)

we can define this function as such and then write:

a%!in%b

Definition for ! :

?Logic

! indicates logical negation (NOT).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM