Што е?

Што ни треба?

Околината на RStudio

Како до помош

TidyTuesday!

The code 1

Load the libraries

suppressPackageStartupMessages(library(tidyverse))
suppressPackageStartupMessages(library(scales))

The code 2

Load the data from github

cpu <-
  readr::read_csv(
    "https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-09-03/cpu.csv"
  )
gpu <-
  readr::read_csv(
    "https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-09-03/gpu.csv"
  )
ram <-
  readr::read_csv(
    "https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-09-03/ram.csv"
  )

The code 3

Make a plot

ggplot(cpu, aes(x=date_of_introduction, y=transistor_count)) +
  geom_smooth(color="lightgrey", size=4, se=FALSE) +
  geom_point(aes(fill=transistor_count), size=3, pch=21) +
  scale_fill_viridis_c(name="Transistor\ncount", alpha=.7) +
  labs(x="Year", y="Transistor count") +
  labs(title="Number of transistors by year") +
  theme_minimal()

The code 4

Make another plot

ggplot(cpu, aes(x=date_of_introduction, y=transistor_count)) +
  geom_smooth(color="lightgrey", size=4, se=FALSE) +
  geom_point(aes(fill=transistor_count), size=3, pch=21) +
  scale_fill_viridis_c(name="Transistor\ncount", alpha=.7) +
  scale_y_continuous(trans="log10", 
          breaks = trans_breaks("log10", function(x) 10^x),
          labels = trans_format("log10", math_format(10^.x))) +
  scale_x_continuous(breaks=seq(1970, 2020, 2)) +
  labs(x="Year", y="Transistor count") +
  labs(title="Number of transistors by year") +
  theme_minimal() +
  theme(axis.text.x = element_text(angle=60, hjust=1, vjust=1))

R референци

Други ресурси што ги искористивме