This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
library(readr)
HeartFailure_excerpt <- read_csv("C:/Users/otuata4438/Downloads/HeartFailure_excerpt.csv")
## Rows: 298 Columns: 8
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## dbl (8): 75, 582, 20, 265000, 1.9, 130, 4, 1
##
## ℹ 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.
View(HeartFailure_excerpt)
sd<-HeartFailure_excerpt
feature_name<-c("Age",
"CPK_enzyme",
"Ejection_fraction",
"Platelets",
"Serum_creatinine",
"Serum_sodium",
"Time",
"DEATH_EVENT")
colnames(HeartFailure_excerpt)<-feature_name
str(HeartFailure_excerpt)
## spc_tbl_ [298 × 8] (S3: spec_tbl_df/tbl_df/tbl/data.frame)
## $ Age : num [1:298] 55 65 50 65 90 75 60 65 80 75 ...
## $ CPK_enzyme : num [1:298] 7861 146 111 160 47 ...
## $ Ejection_fraction: num [1:298] 38 20 20 20 40 15 60 65 35 38 ...
## $ Platelets : num [1:298] 263358 162000 210000 327000 204000 ...
## $ Serum_creatinine : num [1:298] 1.1 1.3 1.9 2.7 2.1 1.2 1.1 1.5 9.4 4 ...
## $ Serum_sodium : num [1:298] 136 129 137 116 132 137 131 138 133 131 ...
## $ Time : num [1:298] 6 7 7 8 8 10 10 10 10 10 ...
## $ DEATH_EVENT : num [1:298] 1 1 1 1 1 1 1 1 1 1 ...
## - attr(*, "spec")=
## .. cols(
## .. `75` = col_double(),
## .. `582` = col_double(),
## .. `20` = col_double(),
## .. `265000` = col_double(),
## .. `1.9` = col_double(),
## .. `130` = col_double(),
## .. `4` = col_double(),
## .. `1` = col_double()
## .. )
## - attr(*, "problems")=<externalptr>
summary(sd)
## 75 582 20 265000
## Min. :40.00 Min. : 23.0 Min. :14.00 Min. : 25100
## 1st Qu.:51.00 1st Qu.: 115.8 1st Qu.:30.00 1st Qu.:212250
## Median :60.00 Median : 249.5 Median :38.00 Median :262000
## Mean :60.79 Mean : 581.8 Mean :38.14 Mean :263353
## 3rd Qu.:70.00 3rd Qu.: 582.0 3rd Qu.:45.00 3rd Qu.:303750
## Max. :95.00 Max. :7861.0 Max. :80.00 Max. :850000
## 1.9 130 4 1
## Min. :0.500 Min. :113.0 Min. : 6.00 Min. :0.0000
## 1st Qu.:0.900 1st Qu.:134.0 1st Qu.: 73.25 1st Qu.:0.0000
## Median :1.100 Median :137.0 Median :115.00 Median :0.0000
## Mean :1.392 Mean :136.6 Mean :130.68 Mean :0.3188
## 3rd Qu.:1.400 3rd Qu.:140.0 3rd Qu.:204.00 3rd Qu.:1.0000
## Max. :9.400 Max. :148.0 Max. :285.00 Max. :1.0000
You can also embed plots, for example:
Note that the echo = FALSE
parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.