del8

Quarto

Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see https://quarto.org.

Running Code

When you click the Render button a document will be generated that includes both content and the output of embedded code. You can embed code like this:

train <- read.csv("~/train.csv")
df <- read.csv("~/train.csv")

You can add options to executable code like this

head(letters)
[1] "a" "b" "c" "d" "e" "f"
tail(letters)
[1] "u" "v" "w" "x" "y" "z"
?str
str(df)
'data.frame':   891 obs. of  12 variables:
 $ PassengerId: int  1 2 3 4 5 6 7 8 9 10 ...
 $ Survived   : int  0 1 1 1 0 0 0 0 1 1 ...
 $ Pclass     : int  3 1 3 1 3 3 1 3 3 2 ...
 $ Name       : chr  "Braund, Mr. Owen Harris" "Cumings, Mrs. John Bradley (Florence Briggs Thayer)" "Heikkinen, Miss. Laina" "Futrelle, Mrs. Jacques Heath (Lily May Peel)" ...
 $ Sex        : chr  "male" "female" "female" "female" ...
 $ Age        : num  22 38 26 35 35 NA 54 2 27 14 ...
 $ SibSp      : int  1 1 0 1 0 0 0 3 0 1 ...
 $ Parch      : int  0 0 0 0 0 0 0 1 2 0 ...
 $ Ticket     : chr  "A/5 21171" "PC 17599" "STON/O2. 3101282" "113803" ...
 $ Fare       : num  7.25 71.28 7.92 53.1 8.05 ...
 $ Cabin      : chr  "" "C85" "" "C123" ...
 $ Embarked   : chr  "S" "C" "S" "S" ...
# install.packages("visdat")
library(visdat)
vis_dat(train)

library(stargazer)

Please cite as: 
 Hlavac, Marek (2022). stargazer: Well-Formatted Regression and Summary Statistics Tables.
 R package version 5.2.3. https://CRAN.R-project.org/package=stargazer 
stargazer(df, type = "text")

==============================================
Statistic    N   Mean   St. Dev.  Min    Max  
----------------------------------------------
PassengerId 891 446.000 257.354    1     891  
Survived    891  0.384   0.487     0      1   
Pclass      891  2.309   0.836     1      3   
Age         714 29.699   14.526  0.420 80.000 
SibSp       891  0.523   1.103     0      8   
Parch       891  0.382   0.806     0      6   
Fare        891 32.204   49.693  0.000 512.329
----------------------------------------------

The echo: false option disables the printing of code (only output is displayed).