Diamond sizes

Published

September 12, 2022

X equals 3.452345^{6} and Y equals 0.1235812.

X equals 3.452.345 and Y equals 0,12.

Diamonds

We have data about 53940 diamonds. Only 126 are larger than 2.5 carats. The distribution of the remainder is shown below:

Formatting

italic bold underline strikeout small caps code Xsupescript Xsubscript

Headings

1st Level Header

2nd Level Header

3rd Level Header

4th Level Header

5th Level Header
6th Level Header

Lists

  • Bulleted list: Item 1
  • Item 2
    • Item A
    • Item B
  1. Numbered list: Item 1

  2. Item 2

    1. Item 2.1

    2. Item 2.2

Tables

First Header Second Header
Content Cell Content Cell
Content Cell Content Cell

Code chunks

1 + 1
# [1] 2
2 * 2

Co můžeme nastavit na false (outputem se myslí konzolový output, messages jsou “nevarovná” hlášení, warnings jsou “varovná”)

Option Run code Show code Output Plots Messages Warnings
eval: false X X X X X
include: false X X X X X
echo: false X
results: hide X
fig-show: hide X
message: false X
warning: false X

Diamond carats by cut, color, and clarity

Tables

mtcars[1:5, ]
#                    mpg cyl disp  hp drat    wt  qsec vs am gear carb
# Mazda RX4         21.0   6  160 110 3.90 2.620 16.46  0  1    4    4
# Mazda RX4 Wag     21.0   6  160 110 3.90 2.875 17.02  0  1    4    4
# Datsun 710        22.8   4  108  93 3.85 2.320 18.61  1  1    4    1
# Hornet 4 Drive    21.4   6  258 110 3.08 3.215 19.44  1  0    3    1
# Hornet Sportabout 18.7   8  360 175 3.15 3.440 17.02  0  0    3    2
knitr::kable(mtcars[1:5, ], )
mpg cyl disp hp drat wt qsec vs am gear carb
Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4
Mazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4
Datsun 710 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1
Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1
Hornet Sportabout 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2

DataTable options

Caching

rawdata <- readr::read_csv("people-10000.csv")
# Rows: 10000 Columns: 9
# ── Column specification ────────────────────────────────────────────────────────
# Delimiter: ","
# chr  (7): User Id, First Name, Last Name, Sex, Email, Phone, Job Title
# dbl  (1): Index
# date (1): Date of birth
# 
# ℹ Use `spec()` to retrieve the full column specification for this data.
# ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
glimpse(rawdata)
# Rows: 10,000
# Columns: 9
# $ Index           <dbl> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,…
# $ `User Id`       <chr> "5f10e9D33fC5f2b", "751cD1cbF77e005", "DcEFDB2D2e62bF9…
# $ `First Name`    <chr> "Sara", "Alisha", "Gwendolyn", "Kristine", "Bobby", "C…
# $ `Last Name`     <chr> "Mcguire", "Hebert", "Sheppard", "Mccann", "Pittman", …
# $ Sex             <chr> "Female", "Male", "Male", "Female", "Female", "Female"…
# $ Email           <chr> "tsharp@example.net", "vincentgarrett@example.net", "m…
# $ Phone           <chr> "(971)643-6089x9160", "+1-114-355-1841x78347", "901780…
# $ `Date of birth` <date> 1921-08-17, 1969-06-28, 1915-09-25, 1978-07-27, 1989-…
# $ `Job Title`     <chr> "Editor, commissioning", "Broadcast engineer", "Indust…
processed_data <- rawdata %>% 
  filter(Sex == "Female")

Citace

To add a citation using the visual editor, go to Insert > Citation. Citations can be inserted from a variety of sources:

  1. DOI (Document Object Identifier) references.

  2. Zotero personal or group libraries.

  3. Searches of Crossref, DataCite, or PubMed.

  4. Your document bibliography (a .bib file in the directory of your document).

Balíček tidyverse (Wickham et al., 2019) je vlastně souborem několika balíčků, včetně např. balíčků dplyr (Wickham et al., 2023)
nebo ggplot2 (Wickham, 2016).

Více citací oddělujeme středníkem (Wickham, 2016; Wickham et al., 2023).

Do hranatých závorek lze doplnit libovolné komentáře:
Blah blah (viz Wickham et al., 2023, pp. 33–35; a také Wickham, 2016, kapitola 1).

Když nepoužijeme hranaté závorky, jedná se o citaci autora přímo v textu (v zárorce bude jen rok):
Wickham et al. (2023) blah blah, nebo Wickham (2016, p. 33) says blah.

Pomlčka/znak pro mínus potlačí jméno autora v závorce: Podle Wickhama et al. (2019)

Citační styly: https://github.com/citation-style-language/styles

Další studium

https://r4ds.hadley.nz/quarto

https://r4ds.hadley.nz/quarto-formats

Citovaná literatura

Wickham, H. (2016). ggplot2: Elegant graphics for data analysis. https://ggplot2.tidyverse.org
Wickham, H., Averick, M., Bryan, J., Chang, W., McGowan, L. D., François, R., Grolemund, G., Hayes, A., Henry, L., Hester, J., Kuhn, M., Pedersen, T. L., Miller, E., Bache, S. M., Müller, K., Ooms, J., Robinson, D., Seidel, D. P., Spinu, V., … Yutani, H. (2019). Welcome to the tidyverse. 4, 1686. https://doi.org/10.21105/joss.01686
Wickham, H., François, R., Henry, L., Müller, K., & Vaughan, D. (2023). Dplyr: A grammar of data manipulation. https://CRAN.R-project.org/package=dplyr