Skip to content

Commit

Permalink
data cleaning exercise
Browse files Browse the repository at this point in the history
  • Loading branch information
caalo committed Mar 21, 2024
1 parent 2d25f66 commit 8fd0c3c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
13 changes: 13 additions & 0 deletions 02-Data_cleaning_1-exercises.Rmd
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
# Data Cleaning, Part 1 Exercises



Suppose that you want to load in some data, and you don't know what tools to use. You decide to see whether the package "readr" can be useful to solve your problem. Where should you look? All R packages must be stored on CRAN (Comprehensive R Archive Network), and all packages have a website that points to the reference manual (what is pulled up using the `?` command), source code, vignettes examples, and dependencies on other packages. Here is [the website](https://cran.r-project.org/web/packages/readr/) for "readr".

In the package, you find some potential functions for importing your data:

- `read_csv("file.csv")` for comma-separated files

- `read_tsv("file.tsv")` for tab-deliminated files

- `read_excel("example.xlsx")` for excel files

- `read_excel("example.xlsx", sheet = "sheet1")` for excel files with a sheet name

- `read_delim()` for general-deliminated files, such as: `read_delim("file.csv", sep = ",")`.

After looking at the vignettes, it seems that `read_delim()` is a function to try.

Let's look at the `read_delim()` function documentation.
Expand Down
13 changes: 0 additions & 13 deletions 02-Data_cleaning_1.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,6 @@ Arguments:
select a range of variables.
```

### Application: Data Importing

Here are some common functions for importing your data:

- `read_csv("file.csv")` for comma-separated files

- `read_tsv("file.tsv")` for tab-deliminated files

- `read_excel("example.xlsx")` for excel files

- `read_excel("example.xlsx", sheet = "sheet1")` for excel files with a sheet name

- `read_delim()` for general-deliminated files, such as: `read_delim("file.csv", sep = ",")`.

You will look at the function documentation on your own to see how to deal with more complex cases.

Expand Down

0 comments on commit 8fd0c3c

Please sign in to comment.