Skip to content

Data Science Tutorials

  • Home
  • R
  • Statistics
  • Course
  • Machine Learning
  • Guest Blog
  • Contact
  • About Us
  • Toggle search form
  • How to move from Junior Data Scientist
    How to move from Junior Data Scientist Machine Learning
  • Best GGPlot Themes
    Best GGPlot Themes You Should Know R
  • Best Online Course For Statistics
    Free Best Online Course For Statistics Course
  • droplevels in R with examples
    droplevels in R with examples R
  • Data Scientist in 2023
    How to Become a Data Scientist in 2023 Machine Learning
  • Select the First Row by Group in R
    Select the First Row by Group 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
  • Making games in R- Nara and eventloop Game Changers
    Making games in R- Nara and eventloop Game Changers Machine Learning
gganatogram Plot in R

How to create Anatogram plot in R

Posted on October 21October 21 By Jim 3 Comments on How to create Anatogram plot in R
Tweet
Share
Share
Pin

How to create Anatogram plot in R, Anatograms can be produced using the same-named package function.

Keep in mind that you can design your own data frame.

Man

Pass the data frame to the function with the parameters and construct the anatogram of a guy.

Please take note that we utilized to keep dimensions and set a blank theme.

install.packages("remotes")
remotes::install_github("jespermaag/gganatogram")
library(gganatogram)
gganatogram(data = hgMale_key,
organism = "human", sex = "male",
fill = "colour", fillOutline = "#a6bddb") +
theme_void() +
coord_fixed()

How to create a ggalluvial plot in R? – Data Science Tutorials

Woman

Anatogram creation for a woman follows a similar procedure to that for a male, except passing the data frame and specifying

library(gganatogram)
gganatogram(data = hgFemale_key,
organism = "human", sex = "female",
fill = "colour", fillOutline = "#a6bddb") +
theme_void() +
coord_fixed()

Zoom

You can utilize it if you need to zoom in on a particular area of the anatogram.

If you want to see the values of the axes, don’t forget to erase the subject.

library(gganatogram)
gganatogram(data = hgMale_key,
organism = "human", sex = "male",
fill = "colour", fillOutline = "#a6bddb") +
coord_cartesian(xlim = c(30, 75), ylim = c(-40, 0)) +
theme_void()

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

Systems

You can only choose a small number of body systems; the default graph displays all of them.

You can choose to merely sketch the systems if you like. To view the available options or type.

library(dplyr)
hgMale_key %>%
filter(type %in% "nervous_system") %>%
gganatogram(organism = "human", sex = "male",
fill = "colour", outline = FALSE) +
theme_void() +
coord_fixed()

Organs

You can sketch some organs in a manner similar to how you draw some systems.

library(dplyr)
hgMale_key %>%
filter(organ %in% c("brain", "heart")) %>%
gganatogram(organism = "human", sex = "male",
fill = "colour") +
theme_void() +
coord_fixed()

colour scale

Based on the column of the data frames, the colour scale can be modified by adding a continuous colour scale, like viridis.

library(dplyr)
hgMale_key %>%
filter(organ %in% c("brain", "heart")) %>%
gganatogram(organism = "human", sex = "male",
fill = "colour") +
theme_void() +
coord_fixed()

Check your inbox or spam folder to confirm your subscription.

Tweet
Share
Share
Pin
R

Post navigation

Previous Post: ggdogs on ggplot2
Next Post: Box Cox transformation in R

Related Posts

  • how to draw heatmap in r
    How to draw heatmap in r: Quick and Easy way R
  • Dealing Missing values in R
    Dealing With Missing values in R R
  • How to Label Outliers in Boxplots in ggplot2
    How to Label Outliers in Boxplots in ggplot2? R
  • How to Recode Values in R
    How to Recode Values in R R
  • Radar plot in R
    How to create Radar Plot in R-ggradar R
  • How to Use Gather Function in R
    How to Use Gather Function in R?-tidyr Part2 R

Comments (3) on “How to create Anatogram plot in R”

  1. Manuel says:
    October 26 at 12:11 am

    > library(dplyr)
    > library(gganatogram)
    > gganatogram(data = hgFemale_key,
    + organism = “human”, sex = “female”,
    + fill = “colour”, fillOutline = “#a6bddb”) +
    + theme_void() +
    + coord_fixed()
    Error in alpha(first_rows$fill, first_rows$alpha) :
    unused argument (first_rows$alpha)

    Reply
    1. Jim says:
      October 26 at 3:19 pm

      theme_void() +
      + coord_fixed()

      Two times + argument

      Reply
  2. Elise says:
    October 30 at 2:32 am

    I’m not a massive user of r, so apologies for what might be a silly question:

    The code under “colour scale” is identical to the code used in “organs”. I cannot tell if this is deliberate because the text described modifying the data frames or a simple copy-paste error.

    Everything above has worked perfectly though, so enormous thanks

    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
  • Tips for Data Scientist Interview Openings
  • What is Epoch in Machine Learning?
  • Dynamic data visualizations in R
  • How Do Machine Learning Chatbots Work
  • Convex optimization role in machine learning

Check your inbox or spam folder to confirm your subscription.

  • Sampling from the population in R
  • Two of the Best Online Data Science Courses for 2023
  • Process of Machine Learning Optimisation?
  • ggplot2 scale in R (grammar for graphics)
  • ggplot aesthetics in R (Grammer of graphics)
  • droplevels in R with examples
    droplevels in R with examples R
  • Statistical test assumptions and requirements
    Statistical test assumptions and requirements Statistics
  • Augmented Dickey-Fuller Test in R
    Augmented Dickey-Fuller Test in R R
  • Convert Multiple Columns to Numeric in R
    Convert Multiple Columns to Numeric in R R
  • How to create a ggalluvial plot in r
    How to create a ggalluvial plot in R? R
  • How to Create a Frequency Table by Group in R
    How to Create a Frequency Table by Group in R? R
  • Extract patterns in R
    Extract patterns in R? R
  • Crosstab calculation in R
    Crosstab calculation in R R

Copyright © 2023 Data Science Tutorials.

Powered by PressBook News WordPress theme