Type: Package
Title: Creates Images Sized for Social Media
Version: 0.1.0
Author: Mikkel Freltoft Krogsholm
Maintainer: Mikkel Freltoft Krogsholm <mikkel@56n.dk>
Description: Creates images that are the proper size for social media. Beautiful plots, charts and graphs wither and die if they are not shared. Social media is perfect for this but every platform has its own image dimensions. With 'smpic' you can easily save your plots with the exact dimensions needed for the different platforms.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Depends: R (≥ 2.10)
Imports: imager, ggplot2, stringr, graphics
URL: https://github.com/mikkelkrogsholm/smpic, https://makeawebsitehub.com/social-media-image-sizes-cheat-sheet/
BugReports: https://github.com/mikkelkrogsholm/smpic/issues
RoxygenNote: 6.0.1
Suggests: knitr, rmarkdown, testthat, dplyr
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2017-10-03 23:46:25 UTC; mikkel
Repository: CRAN
Date/Publication: 2017-10-04 08:42:13 UTC

Overview of Image Dimensions for Social Media

Description

This data set contains dimensions for 32 different images sizes for most social media sites

Usage

smpic_dim

Format

A data frame with 32 rows and 6 variables:

media

the social media in question

picture

the type of image in question

width

the width of image in question

height

the height of image in question

dimension

the dimension of image in question - height / width

id

the id of image in question

Source

https://makeawebsitehub.com/social-media-image-sizes-cheat-sheet/


Save a social media sized ggplot

Description

Save a social media sized ggplot

Usage

smpic_save(p, filename = NULL, sm = c("facebook_shared_images",
  "facebook_profile_image", "facebook_cover_photo", "facebook_shared_link",
  "facebook_highlighted_image", "facebook_event_image",
  "linkedin_profile_image", "linkedin_standard_logo", "linkedin_hero_image",
  "linkedin_business_banner_image", "linkedin_square_logo",
  "youtube_channel_cover_photo", "youtube_video_uploads",
  "instagram_profile_image", "instagram_photo_thumbnails",
  "instagram_photo_size", "twitter_header_photo", "twitter_profile_image",
  "twitter_in-stream_photo",      "pinterest_profile_image",
  "pinterest_board_display", "pinterest_board_display_thumbnails",
  "pinterest_pin_sizes", "tumblr_profile_image", "tumblr_image_posts",
  "g+_profile_image", "g+_cover_image", "g+_shared_image", "g+_shared_video",
  "g+_shared_image_square", "ello_banner_image", "ello_profile_image"),
  text_factor = 1, custom_dims = NULL)

Arguments

p

the ggplot you want to preview.

filename

filename for your plot.

sm

the social media picture type you want it sized to.

text_factor

a factor for the text in the plot. Change it if the text looks to small.

custom_dims

a vector of width and height for your own custom size.

Examples

library(dplyr)
library(ggplot2)
library(smpic)

p <- ggplot(iris) +
     geom_point(aes(Petal.Length, Petal.Width, color = Species), show.legend = FALSE) +
       geom_label(data = summarise_if(group_by(iris, Species), is.numeric, mean),
                  aes(Petal.Length, Petal.Width, label = Species, color = Species),
                  show.legend = FALSE) +
       labs(x = "Petal Length", y = "Petal Width",
            title = "Look mom, a flower plot!",
            subtitle = "Yet another iris data set visualization.",
            caption = "Source: iris") +
       theme_minimal()

  smpic_view(p, sm = "facebook_shared_images", text_factor = 2.2)

  smpic_save(p, filename = "my_new_social_media_plot.png",
             sm = "facebook_shared_images", text_factor = 2.2)

Preview a social media sized ggplot

Description

Preview a social media sized ggplot

Usage

smpic_view(p, sm = c("facebook_shared_images", "facebook_profile_image",
  "facebook_cover_photo", "facebook_shared_link", "facebook_highlighted_image",
  "facebook_event_image", "linkedin_profile_image", "linkedin_standard_logo",
  "linkedin_hero_image", "linkedin_business_banner_image",
  "linkedin_square_logo", "youtube_channel_cover_photo",
  "youtube_video_uploads", "instagram_profile_image",
  "instagram_photo_thumbnails", "instagram_photo_size", "twitter_header_photo",
  "twitter_profile_image", "twitter_in-stream_photo",     
  "pinterest_profile_image", "pinterest_board_display",
  "pinterest_board_display_thumbnails", "pinterest_pin_sizes",
  "tumblr_profile_image", "tumblr_image_posts", "g+_profile_image",
  "g+_cover_image", "g+_shared_image", "g+_shared_video",
  "g+_shared_image_square", "ello_banner_image", "ello_profile_image"),
  text_factor = 1, custom_dims = NULL)

Arguments

p

the ggplot you want to preview.

sm

the social media picture type you want it sized to.

text_factor

a factor for the text in the plot. Change it if the text looks to small.

custom_dims

a vector of width and height for your own custom size.

Value

a plot

Examples

library(dplyr)
library(ggplot2)
library(smpic)

p <- ggplot(iris) +
     geom_point(aes(Petal.Length, Petal.Width, color = Species), show.legend = FALSE) +
       geom_label(data = summarise_if(group_by(iris, Species), is.numeric, mean),
                  aes(Petal.Length, Petal.Width, label = Species, color = Species),
                  show.legend = FALSE) +
       labs(x = "Petal Length", y = "Petal Width",
            title = "Look mom, a flower plot!",
            subtitle = "Yet another iris data set visualization.",
            caption = "Source: iris") +
       theme_minimal()

  smpic_view(p, sm = "facebook_shared_images", text_factor = 2.2)

mirror server hosted at Truenetwork, Russian Federation.