Learn R Programming

⚠️There's a newer version (1.2.1) of this package.Take me there.

r2social R package: include social links and connect buttons in Rmarkdown and shiny applications

Official site: https://r2social.obi.obianom.com

View a live demo: r2social demo
The goal of this new R package is to provide functions that allow the inclusion of share and connect buttons on any page. This has been tested in Rmarkdown documents as well as on simply Shiny applications. See the examples folder of this package.

Installation and Library Attachment

The r2social package is available on CRAN and can be installed as shown below

install.packages(r2social)

Attach library

library(r2social)

Shiny application


library(shiny)
library(r2social)


#ex 1 - to share various links
ui <- fluidPage(
  r2social.scripts(),
  shareButton(link = "https://rpkg.net", position = "left"),
  shareButton(link = "https://shinyappstore.com", position = "inline"),
  shareButton(link = "https://shinyappstore.com", plain = T, position = "inline"), #plain style
  shareButton(link = "https://obianom.com", position = "right")
)

#ex 2 - to link your page to specific domain online
ui <- fluidPage(
  r2social.scripts(),
  # to my personal website
  connectButton(link = "https://obianom.com", position = "inline",link.out = FALSE, visit.us = TRUE),

  # to my Twitter/X page
  connectButton(link = "https://x.com/R2Rpkg", position = "inline",link.out = FALSE, x = TRUE)
)

Rmarkdown document


library(r2social)

r2social.scripts()
shareButton(link = "https://rpkg.net", position = "left")
shareButton(link = "https://shinyappstore.com", position = "inline")
shareButton(link = "https://obianom.com", position = "right")


Copy Link

Version

Install

install.packages('r2social')

Monthly Downloads

195

Version

1.1

License

MIT + file LICENSE

Maintainer

Obinna Obianom

Last Published

January 10th, 2024

Functions in r2social (1.1)

shareButton

Add social buttons to share a page
r2social.scripts

Add r2social scripts
connectButton

Add Connect with us buttons
socialButtons

Customizable social icons
r2social-package

r2social: App Inclusion of Social Sharing and Connect Buttons