Skip to content

Commit

Permalink
Merge pull request #50 from dfe-analytical-services/updated-UTF-8-enc…
Browse files Browse the repository at this point in the history
…oding-advice

write.csv() update
  • Loading branch information
cjrace authored Apr 26, 2024
2 parents d1287cd + 91750c4 commit 43ad4c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions statistics-production/ud.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,10 @@ For saving results out of SQL as a .csv file there isn't an option to specify th

**R**

When writing .csv files out of R, you'll mostly likely be using either `write.csv()` from base R, or `write_csv()` from the readr package. For the first one, you can specify encoding using `encoding = ` like the following example:
When writing .csv files out of R, you'll mostly likely be using either `write.csv()` from base R, or `write_csv()` from the readr package. For the first one, you can specify encoding using `fileEncoding = ` like the following example:


`write.csv(my_data, file = "my_data_file.csv", encoding = "UTF-8")`
`write.csv(my_data, file = "my_data_file.csv", fileEncoding = "UTF-8")`


For `write_csv()`, which some of you may be using for increased processing speed, the function automatically encodes as UTF-8 format, meaning that you don't have to do anything different!
Expand Down Expand Up @@ -1396,4 +1396,4 @@ For example, in tabulated form:
| ethnicity_minor | ethnicity_major | Irish | White | | | |
| ethnicity_minor | ethnicity_major | Arab | Other ethnic group | | | |

:::
:::

0 comments on commit 43ad4c9

Please sign in to comment.