神刀安全网

The adblockr package: block ads from the monetizr package

(This article was first published on Variance Explained , and kindly contributed toR-bloggers)

I was horrified to learn of the existence of the monetizr package , which adds advertisements to R functions. The package goes against the entire philosophy of open source and the spirit of the R community.

Luckily, I was able to construct a fix- the adblockr package .

Use freely to get an ad-free experience

For example, imagine someone locked the useful multiply_by_two function behind an annoying ad:

library(monetizr)  multiply_by_two <- function(x) {   x * 2 }  multiply_by_two <- marketably(multiply_by_two,                               "This is an awful, distracting ad")  multiply_by_two(10)

## This is an awful, distracting ad

## [1] 20

The adblockr package offers the freely adverb, which converts the multiply_by_two function back to give you an ad-free experience:

library(adblockr)  multiply_by_two <- freely(multiply_by_two) multiply_by_two(5)

## [1] 10

The package also includes the block_all function for removing all ads from a package. For example, once the next version of broom is monetized, you can block all ads in the package with:

library(broom)  block_all("broom")

If enough of us use this, it will hopefully send a message to the greedy monetizr maintainer that ads have no place in R.

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » The adblockr package: block ads from the monetizr package

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
分享按钮