Quantcast
Channel: r software hub
Viewing all articles
Browse latest Browse all 1015

The monetizr package: make money on your open source R packages

$
0
0

By David Robinson

I’ve had the great privilege to be a small part of the R open source community, contributing packages like broom, gganimate, fuzzyjoin, and ggfreehand. In the process I’ve become friends and colleagues with brilliant statisticians and data scientists and learned to engage with data in powerful ways.

But there’s one thing that my colleagues and I haven’t gotten from R open source involvement: money. Until now.

Introducing the monetizr package

To this end, I am introducing the monetizr package, which lets you monetize a package through advertisements.

Suppose you’ve created a function:

multiply_by_two  function(x) {
  x * 2
}

This function takes its input and multiplies it by two. By enterprise software standards this is quite useful.

You’ve shared your function and people are using it:

multiply_by_two(10)
## [1] 20

But every time they use it, you are not capturing the value- you are in fact getting nothing from it. What a ripoff!

Marketably

The monetize package provides the marketably function, which modifies a function to display an advertisement. (Why “marketably”? Because functions that return other functions should be adverbs). You can provide ads for paying third parties, or you can advertise your own work. Here I’ll add an advertisement for my blog:

library(monetizr)

ad  "Check out my blog, Variance Explained, at www.varianceexplained.org!"
multiply_by_two_enterprise  marketably(multiply_by_two, ad)

Now, when anyone calls it:

multiply_by_two_enterprise(10)
## Check out my blog, Variance Explained, at www.varianceexplained.org!
## [1] 20

You’ve captured some value!

Also try the html = TRUE argument. Now thanks to htmltools, this will pop up in the user’s browser or RStudio “Viewer” window, where it is even harder for your customers to ignore.

ad  paste("Check out my blog, ",
            "Variance Explained")
multiply_by_two_enterprise  marketably(multiply_by_two, ad, html = TRUE)

multiply_by_two_enterprise(20)

You can also insert a delay (in seconds) after …read more

Source:: r-bloggers.com


Viewing all articles
Browse latest Browse all 1015

Trending Articles