Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Basic Infix Binary Operators

License

NotificationsYou must be signed in to change notification settings

ebeneditos/infix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic Infix Binary Operators

CRANDownloadsTravis CI StatusAppVeyor build statusCodecovLicense

Contains a number of infix binary operators that may be useful in day to day practices.

Installation

You can installinfix from CRAN:

install.packages("infix")

Or the development version from GitHub:

# install.packages("devtools")devtools::install_github("ebeneditos/infix")

Usage

You can find a full list of operators running?infix, but here there are a few examples:

library(infix)# tryExcept (%except%){foo<-"foo"} %except% {foo<-"foo bar"}print(foo)# "foo"{foo<-"foo"  stop()} %except% {foo<-"foo bar"}print(foo)# "foo bar"# paste0 (%+%)"01" %+%"jan" %+%"1970"# returns "01jan1970"# file.path (%//%)"home" %//%"dir"# returns "home/dir"# nomatch (%!in%)4 %!in%1:3# returns TRUE# nil (%||%)1 %||%2# returns 1NULL %||%2# returns 2# functions logic (%&%, %|% and %xor%)is.null.na<-is.null %|%is.naall(is.null.na(NA), is.null.na(NULL))# returns TRUE

Also,magrittr pipe-operators (such as%>%) are imported.

About

Basic Infix Binary Operators

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp