Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 03-basics-factors-dataframes.Rmd #234

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions episodes/03-basics-factors-dataframes.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -618,11 +618,11 @@ snp_chromosomes_2
```

Trouble can really start when we try to coerce a factor. For example, when we
try to coerce the `sample_id` column in our data frame into a numeric mode
try to coerce the `factor_snps` vector into a numeric mode
look at the result:

```{r, purl=FALSE}
as.numeric(variants$sample_id)
as.numeric(factor_snps)
```

Strangely, it works! Almost. Instead of giving an error message, R returns
Expand Down