Skip to content

Commit

Permalink
ugh merging issue
Browse files Browse the repository at this point in the history
  • Loading branch information
carriewright11 committed Sep 30, 2024
1 parent 9673be8 commit 7b47fdb
Show file tree
Hide file tree
Showing 2 changed files with 1,178 additions and 4 deletions.
16 changes: 13 additions & 3 deletions modules/Subsetting_Data_in_R/Subsetting_Data_in_R.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -347,19 +347,29 @@ library(janitor)

## janitor `clean_names`

The `clean_names` function can intuit what fixes you might need. Here it make sure year names aren't just a number, so that the colnames don't need ticks or quotes to be used.
The `clean_names` function can intuit what fixes you might need.

The yearly_co2_emissions dataset contains estimated CO2 emissions for 265 countries between the years 1751 and 2014.

```{r}
#library(dasehr)
yearly_co2 <- dasehr::yearly_co2_emissions
#yearly_co2 <- dasehr::yearly_co2_emissions
# or this:
yearly_co2 <-
read_csv("https://daseh.org/data/Yearly_CO2_Emissions_1000_tonnes.csv")
```

## yearly_co2 column names

```{r}
head(yearly_co2, n = 2)
clean_names(yearly_co2)
```

## janitor `clean_names` can intuit fixes
The `clean_names` function can intuit what fixes you might need. Here it make sure year names aren't just a number, so that the colnames don't need ticks or quotes to be used.

```{r}
clean_names(yearly_co2)
```

## more of clean_names
Expand Down
1,166 changes: 1,165 additions & 1 deletion modules/Subsetting_Data_in_R/Subsetting_Data_in_R.html

Large diffs are not rendered by default.

0 comments on commit 7b47fdb

Please sign in to comment.