Skip to content

Data Science Tutorials

  • Home
  • R
  • Statistics
  • Course
  • Machine Learning
  • Guest Blog
  • Contact
  • About Us
  • Toggle search form
  • Boosting in Machine Learning
    Boosting in Machine Learning:-A Brief Overview Machine Learning
  • How Do Online Criminals Acquire Sensitive Data
    How Do Online Criminals Acquire Sensitive Data Machine Learning
  • Convert Multiple Columns to Numeric in R
    Convert Multiple Columns to Numeric in R R
  • Arrange the rows in a specific sequence in R
    Arrange the rows in a specific sequence in R R
  • How to Create a Frequency Table by Group in R
    How to Create a Frequency Table by Group in R? R
  • How To Become a Business Intelligence Analyst
    How To Become a Business Intelligence Analyst Course
  • Add new calculated variables to a data frame and drop all existing variables
    Add new calculated variables to a data frame and drop all existing variables R
  • best books about data analytics
    Best Books to learn Tensorflow Course
ggdogs on ggplot2

ggdogs on ggplot2

Posted on October 21October 21 By Jim 1 Comment on ggdogs on ggplot2
Tweet
Share
Share
Pin

ggdogs on ggplot2, With the help of the function instead of, you may use the package to add dog-related photos in place of dots in ggplot2.

ggdogsgeom_doggeom_point 

You can send any of the sentences listed above to the feature to use the associated dog images. There are currently 15 different breeds of dogs accessible, called (by default),.

How to Add a caption to ggplot2 Plots in R? (datasciencetut.com)

"doge""doge_strong""chihuahua""eyes""gabe""glasses""tail""surprised""thisisfine""hearing""pug""ears""husky""husky_2""chilaquil"

All of the dogs are shown in the following figure:

install.packages("remotes")
remotes::install_github("R-CoderDotCom/ggdogs@main")
library(ggdogs)
install.packages("ggplot2")
library(ggplot2)
grid <- expand.grid(1:5, 3:1)
df <- data.frame(x = grid[, 1],
y = grid[, 2],
image = c("doge", "doge_strong", "chihuahua",
"eyes", "gabe", "glasses",
"tail", "surprised", "thisisfine",
"hearing", "pug", "ears",
"husky", "husky_2", "chilaquil"))
ggplot(df) +
geom_dog(aes(x, y, dog = image), size = 5) +
geom_text(aes(x, y - 0.5, label = image), size = 2.5) +
xlim(c(0.25, 5.5)) +
ylim(c(0.25, 3.5))

Making dog-themed graphics using geom_dog

The function can be used in the same way as when given a data frame. The primary distinction is that default points have been replaced with Doge dogs.

Note that the function’s argument allows you to change the size of photos.

5 Free Books to Learn Statistics For Data Science – Data Science Tutorials

geom_doggeom_pointsize

Additionally, you can combine typical charts with. In the example below, we’re making a scatter plot with a picture of a dog and some text.

set.seed(123)
df <- data.frame(x = 1:10, y = rnorm(10))
ggplot(df, aes(x = x, y = y)) +
geom_point(size = 3, color = 4) +
geom_dog(aes(x = 7, y = -0.5), dog = "thisisfine", size = 5) +
geom_label(aes(x = 7.75, y = -0.1, label = "datasciencetut.com"))

Be aware that you can send that column as an argument so that each point has the appropriate dog if your data frame contains a column with the dog name matching each data point.

set.seed(123)
df <- data.frame(x = 1:10, y = rnorm(10),
dog = c(rep("husky", 5),
rep("gabe", 5)))
ggplot(df, aes(x = x, y = y, dog = dog)) +
geom_dog(size = 5)

The final illustration displays a number of Doge canines.

How to make a rounded corner bar plot in R? – Data Science Tutorials

set.seed(123)
df <- data.frame(x = 1:10, y = rnorm(10),
dog = c(rep("husky", 5),
rep("gabe", 5)))
ggplot(df, aes(x = x, y = y)) +
geom_dog(size = 2.5) +
geom_dog(aes(x = 5, y = 0.25, dog = "doge_strong"), size = 12)

Check your inbox or spam folder to confirm your subscription.

Tweet
Share
Share
Pin
R

Post navigation

Previous Post: How to create Radar Plot in R-ggradar
Next Post: How to create Anatogram plot in R

Related Posts

  • Boosting in Machine Learning
    Boosting in Machine Learning:-A Brief Overview Machine Learning
  • Dealing Missing values in R
    Dealing With Missing values in R R
  • How to Find Unmatched Records in R
    How to Find Unmatched Records in R R
  • Two-Way ANOVA Example in R
    How to perform a one-sample t-test in R? R
  • Survival Plot in R
    How to Perform a Log Rank Test in R R
  • Difference between R and Python
    Difference between R and Python R

Comment (1) on “ggdogs on ggplot2”

  1. Asei ITO says:
    October 26 at 8:34 pm

    This is great.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • About Us
  • Contact
  • Disclaimer
  • Guest Blog
  • Privacy Policy
  • YouTube
  • Twitter
  • Facebook
  • Defensive Programming Strategies in R
  • Plot categorical data in R
  • Top Data Modeling Tools for 2023
  • Ogive Graph in R
  • Is R or Python Better for Data Science in Bangalore

Check your inbox or spam folder to confirm your subscription.

  • Data Scientist Career Path Map in Finance
  • Is Python the ideal language for machine learning
  • Convert character string to name class object
  • How to play sound at end of R Script
  • Pattern Searching in R
  • Replace NA with Zero in R
    Replace NA with Zero in R R
  • Interactive 3d plot in R
    Interactive 3d plot in R-Quick Guide R
  • How to put margins on tables or arrays in R?
    How to put margins on tables or arrays in R? R
  • Top 7 Skills Required to Become a Data Scientist
    Top 7 Skills Required to Become a Data Scientist Machine Learning
  • How to Count Distinct Values in R
    How to Count Distinct Values in R R
  • How to Add Superscripts and Subscripts to Plots in R?, The basic syntax for adding superscripts or subscripts to charts in R is as follows:
    How to Add Superscripts and Subscripts to Plots in R? R
  • Error in solve.default(mat)  Lapack routine dgesv system is exactly singular
    Error in solve.default(mat) :  Lapack routine dgesv: system is exactly singular: U[2,2] = 0 R
  • OLS Regression in R
    OLS Regression in R R

Copyright © 2023 Data Science Tutorials.

Powered by PressBook News WordPress theme