微分積分

Mathematics
Author

Nobukuni Hyakutake

Published

2024-05-22

1 基本

1.1 数直線

数直線上に有理数、無理数をプロットする。

library(tidyverse)
library(ggrepel)
g_width <- 100
g_height <- 100 * 2 / (1 + sqrt(5))
d01 <- read_csv("
              point,value
              1,0
              2,1
              3,2
              4,3
              5,-1
              6,-2
              7,-3
              ", show_col_types = FALSE)
d01$label <- as.character(d01$value)
d02 <- c(1 / 2, -3 / 2, sqrt(2), pi, -sqrt(3))
d03 <- tibble(
  point = seq(8, 12),
  value = d02,
  label = c("frac(1,2)", "-frac(3,2)", "sqrt(2)", "pi", "-sqrt(3)")
) #?plotmath で文法は調べられる
d04 <- bind_rows(d01, d03)
ggplot(d04, aes(value, 1, label = label)) +
  geom_pointrange(aes(xmin = -4, xmax = 4)) +
  geom_point() +
  geom_label_repel(parse = TRUE)

2 参考文献

3 R version

R.version.string
[1] "R version 4.4.0 (2024-04-24)"