## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.5
## ✔ forcats 1.0.0 ✔ stringr 1.5.2
## ✔ ggplot2 4.0.0 ✔ tibble 3.3.0
## ✔ lubridate 1.9.4 ✔ tidyr 1.3.1
## ✔ purrr 1.1.0
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
## Loading required package: airports
## Loading required package: cherryblossom
## Loading required package: usdata
Veri setini inceleme işlemi glimpsefonksiyonu ile yapılabilir
## Rows: 82
## Columns: 3
## $ year <int> 1629, 1630, 1631, 1632, 1633, 1634, 1635, 1636, 1637, 1638, 1639…
## $ boys <int> 5218, 4858, 4422, 4994, 5158, 5035, 5106, 4917, 4703, 5359, 5366…
## $ girls <int> 4683, 4457, 4102, 4590, 4839, 4820, 4928, 4605, 4457, 4952, 4784…
veri setindeki kız sayıları
## [1] 4683 4457 4102 4590 4839 4820 4928 4605 4457 4952 4784 5332 5200 4910 4617
## [16] 3997 3919 3395 3536 3181 2746 2722 2840 2908 2959 3179 3349 3382 3289 3013
## [31] 2781 3247 4107 4803 4881 5681 4858 4319 5322 5560 5829 5719 6061 6120 5822
## [46] 5738 5717 5847 6203 6033 6041 6299 6533 6744 7158 7127 7246 7119 7214 7101
## [61] 7167 7302 7392 7316 7483 6647 6713 7229 7767 7626 7452 7061 7514 7656 7683
## [76] 5738 7779 7417 7687 7623 7380 7288
:Kızlar değişim trendi ………
ggplot(data = arbuthnot, aes(x = year, y = girls)) +
geom_line() +
theme_bw() +
labs(x= "kiz sayisi",
y= "Yillar")toplam sayı
## [1] 9901 9315 8524 9584 9997 9855 10034 9522 9160 10311 10150 10850
## [13] 10670 10370 9410 8104 7966 7163 7332 6544 5825 5612 6071 6128
## [25] 6155 6620 7004 7050 6685 6170 5990 6971 8855 10019 10292 11722
## [37] 9972 8997 10938 11633 12335 11997 12510 12563 11895 11851 11775 12399
## [49] 12626 12601 12288 12847 13355 13653 14735 14702 14730 14694 14951 14588
## [61] 14771 15211 15054 14918 15159 13632 13976 14861 15829 16052 15363 14639
## [73] 15616 15687 15448 11851 16145 15369 16066 15862 15220 14928
mutate fonksiyonu ile yeni değişken ekleme
erkek kız oranı
Insert any text here.
Erkelerin kızlardan fazla olması
arbuthnot <- arbuthnot %>%
mutate(more_boys = boys > girls)
arbuthnot <- arbuthnot %>%
mutate(more_boys_numeric = as.numeric(boys > girls))
arbuthnot ## # A tibble: 82 × 7
## year boys girls total boy_to_girl_ratio more_boys more_boys_numeric
## <int> <int> <int> <int> <dbl> <lgl> <dbl>
## 1 1629 5218 4683 9901 1.11 TRUE 1
## 2 1630 4858 4457 9315 1.09 TRUE 1
## 3 1631 4422 4102 8524 1.08 TRUE 1
## 4 1632 4994 4590 9584 1.09 TRUE 1
## 5 1633 5158 4839 9997 1.07 TRUE 1
## 6 1634 5035 4820 9855 1.04 TRUE 1
## 7 1635 5106 4928 10034 1.04 TRUE 1
## 8 1636 4917 4605 9522 1.07 TRUE 1
## 9 1637 4703 4457 9160 1.06 TRUE 1
## 10 1638 5359 4952 10311 1.08 TRUE 1
## # ℹ 72 more rows
betimsel istatsitik
## # A tibble: 1 × 2
## minumum maxsimum
## <int> <int>
## 1 2890 8426
What years are included in this data set? What are the dimensions of the data frame? What are the variable (column) names?
## [1] 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643
## [16] 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658
## [31] 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673
## [46] 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688
## [61] 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703
## [76] 1704 1705 1706 1707 1708 1709 1710
## [1] 82 7
## [1] 82
## [1] 7
Insert any text here.
library(ggplot2)
ggplot(arbuthnot, aes(x=year,y=boy_to_girl_ratio)) +
geom_line() +
xlim(c(1625,1710))Insert any text here.
## # A tibble: 82 × 7
## year boys girls total boy_to_girl_ratio more_boys more_boys_numeric
## <int> <int> <int> <int> <dbl> <lgl> <dbl>
## 1 1705 8366 7779 16145 1.08 TRUE 1
## 2 1707 8379 7687 16066 1.09 TRUE 1
## 3 1698 8426 7626 16052 1.10 TRUE 1
## 4 1708 8239 7623 15862 1.08 TRUE 1
## 5 1697 8062 7767 15829 1.04 TRUE 1
## 6 1702 8031 7656 15687 1.05 TRUE 1
## 7 1701 8102 7514 15616 1.08 TRUE 1
## 8 1703 7765 7683 15448 1.01 TRUE 1
## 9 1706 7952 7417 15369 1.07 TRUE 1
## 10 1699 7911 7452 15363 1.06 TRUE 1
## # ℹ 72 more rows