Skip to content

Instantly share code, notes, and snippets.

@batpigandme
Last active November 16, 2018 14:55
Show Gist options
  • Save batpigandme/07ed55cc09c330ca4541e6aa9cb39a74 to your computer and use it in GitHub Desktop.
Save batpigandme/07ed55cc09c330ca4541e6aa9cb39a74 to your computer and use it in GitHub Desktop.
suppressPackageStartupMessages(library(tidyverse))
library(forcats)
# source: https://fossa.io/blog/which-open-source-license-is-the-best-for-commercialization/
os_licenses <- tibble::tribble(
~license, ~valuations_pct,
"MPLv2", 1.5,
"LGPL v2.1", 1.5,
"GPL v2", 49.4,
"AGPL v3", 3.4,
"Apache 2.0", 35.3,
"BSD", 1.1,
"CDDL", 1.1,
"CPAL", 4.8,
"other", 1.9
)
sum(os_licenses$valuations_pct)
os_licenses <- os_licenses %>%
arrange(valuations_pct)
licenses <- os_licenses$license
os_licenses %>%
mutate(license = as_factor(license),
licence = fct_reorder(license, valuations_pct, .desc = TRUE)) %>%
ggplot(aes(license, valuations_pct)) +
geom_bar(stat = "identity") +
coord_flip() +
scale_y_continuous(expand = c(0,0)) +
hrbrthemes::theme_ipsum_rc()
licence_valuation <- tibble::tribble(
~license, ~pct_avg_valuation,
"OSL v3, AFL v3", 5.9,
"MPLv2", 7,
"LGPL v3", 3.5,
"LGPL v2.1+", 7,
"GPL v2", 26,
"CPAL", 22.7,
"CDDL", 5.2,
"BSD", 5.2,
"Apache 2.0", 9.3,
"AGPL v3", 8
)
licence_valuation <- licence_valuation %>%
arrange(pct_avg_valuation)
licence_valuation %>%
mutate(license = as_factor(license),
licence = fct_reorder(license, pct_avg_valuation, .desc = TRUE)) %>%
ggplot(aes(license, pct_avg_valuation)) +
geom_bar(stat = "identity") +
coord_flip() +
scale_y_continuous(expand = c(0,0)) +
hrbrthemes::theme_ipsum_rc()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment