Use encoding=“UTF-8” in rio
Some of my students got an issue yesterday. I tried to solve it with some code examples from Stackoverflow, but none of them worked for me.
I tried to import an .xlsx
file and some of the characters like "ü" got replaced by "". It seems that this is an encoding problem, so I tried the following:
library(rio)
df <- import("example.xlsx",encoding = "UTF-8", na="...")
R throws back this error:
unused argument (encoding = "UTF-8 ")
I have to use the Rio package! So does anybody has a solution for my problem?
It seems that this problem mostly appears on Mac computers with OSX.
I really appreciate your help, thanks a lot!
r utf-8
add a comment |
Some of my students got an issue yesterday. I tried to solve it with some code examples from Stackoverflow, but none of them worked for me.
I tried to import an .xlsx
file and some of the characters like "ü" got replaced by "". It seems that this is an encoding problem, so I tried the following:
library(rio)
df <- import("example.xlsx",encoding = "UTF-8", na="...")
R throws back this error:
unused argument (encoding = "UTF-8 ")
I have to use the Rio package! So does anybody has a solution for my problem?
It seems that this problem mostly appears on Mac computers with OSX.
I really appreciate your help, thanks a lot!
r utf-8
2
rio::import()
(no captial I) just callsreadxl::read_excel()
for xlsx files. This isread_excel()
's signature:read_excel(path, sheet = NULL, range = NULL, col_names = TRUE, col_types = NULL, na = "", trim_ws = TRUE, skip = 0, n_max = Inf, guess_max = min(1000, n_max))
. It has noencoding
parameter. Take a look at github.com/tidyverse/readxl/issues/125 which was found via a search forr read_excel utf-8
– hrbrmstr
Nov 10 at 14:26
Yes i know theread_excel
function, but i didn't know that theimport
function just calls it. I will use this then, thank you.
– Larsg432
Nov 11 at 10:43
look at the R manual page forimport
. it lists all the functions that it dispatches the actual work to depending on file format.
– hrbrmstr
Nov 11 at 10:48
add a comment |
Some of my students got an issue yesterday. I tried to solve it with some code examples from Stackoverflow, but none of them worked for me.
I tried to import an .xlsx
file and some of the characters like "ü" got replaced by "". It seems that this is an encoding problem, so I tried the following:
library(rio)
df <- import("example.xlsx",encoding = "UTF-8", na="...")
R throws back this error:
unused argument (encoding = "UTF-8 ")
I have to use the Rio package! So does anybody has a solution for my problem?
It seems that this problem mostly appears on Mac computers with OSX.
I really appreciate your help, thanks a lot!
r utf-8
Some of my students got an issue yesterday. I tried to solve it with some code examples from Stackoverflow, but none of them worked for me.
I tried to import an .xlsx
file and some of the characters like "ü" got replaced by "". It seems that this is an encoding problem, so I tried the following:
library(rio)
df <- import("example.xlsx",encoding = "UTF-8", na="...")
R throws back this error:
unused argument (encoding = "UTF-8 ")
I have to use the Rio package! So does anybody has a solution for my problem?
It seems that this problem mostly appears on Mac computers with OSX.
I really appreciate your help, thanks a lot!
r utf-8
r utf-8
edited Nov 10 at 17:01
kit
1,1083616
1,1083616
asked Nov 10 at 14:10
Larsg432
585
585
2
rio::import()
(no captial I) just callsreadxl::read_excel()
for xlsx files. This isread_excel()
's signature:read_excel(path, sheet = NULL, range = NULL, col_names = TRUE, col_types = NULL, na = "", trim_ws = TRUE, skip = 0, n_max = Inf, guess_max = min(1000, n_max))
. It has noencoding
parameter. Take a look at github.com/tidyverse/readxl/issues/125 which was found via a search forr read_excel utf-8
– hrbrmstr
Nov 10 at 14:26
Yes i know theread_excel
function, but i didn't know that theimport
function just calls it. I will use this then, thank you.
– Larsg432
Nov 11 at 10:43
look at the R manual page forimport
. it lists all the functions that it dispatches the actual work to depending on file format.
– hrbrmstr
Nov 11 at 10:48
add a comment |
2
rio::import()
(no captial I) just callsreadxl::read_excel()
for xlsx files. This isread_excel()
's signature:read_excel(path, sheet = NULL, range = NULL, col_names = TRUE, col_types = NULL, na = "", trim_ws = TRUE, skip = 0, n_max = Inf, guess_max = min(1000, n_max))
. It has noencoding
parameter. Take a look at github.com/tidyverse/readxl/issues/125 which was found via a search forr read_excel utf-8
– hrbrmstr
Nov 10 at 14:26
Yes i know theread_excel
function, but i didn't know that theimport
function just calls it. I will use this then, thank you.
– Larsg432
Nov 11 at 10:43
look at the R manual page forimport
. it lists all the functions that it dispatches the actual work to depending on file format.
– hrbrmstr
Nov 11 at 10:48
2
2
rio::import()
(no captial I) just calls readxl::read_excel()
for xlsx files. This is read_excel()
's signature: read_excel(path, sheet = NULL, range = NULL, col_names = TRUE, col_types = NULL, na = "", trim_ws = TRUE, skip = 0, n_max = Inf, guess_max = min(1000, n_max))
. It has no encoding
parameter. Take a look at github.com/tidyverse/readxl/issues/125 which was found via a search for r read_excel utf-8
– hrbrmstr
Nov 10 at 14:26
rio::import()
(no captial I) just calls readxl::read_excel()
for xlsx files. This is read_excel()
's signature: read_excel(path, sheet = NULL, range = NULL, col_names = TRUE, col_types = NULL, na = "", trim_ws = TRUE, skip = 0, n_max = Inf, guess_max = min(1000, n_max))
. It has no encoding
parameter. Take a look at github.com/tidyverse/readxl/issues/125 which was found via a search for r read_excel utf-8
– hrbrmstr
Nov 10 at 14:26
Yes i know the
read_excel
function, but i didn't know that the import
function just calls it. I will use this then, thank you.– Larsg432
Nov 11 at 10:43
Yes i know the
read_excel
function, but i didn't know that the import
function just calls it. I will use this then, thank you.– Larsg432
Nov 11 at 10:43
look at the R manual page for
import
. it lists all the functions that it dispatches the actual work to depending on file format.– hrbrmstr
Nov 11 at 10:48
look at the R manual page for
import
. it lists all the functions that it dispatches the actual work to depending on file format.– hrbrmstr
Nov 11 at 10:48
add a comment |
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53239782%2fuse-encoding-utf-8-in-rio%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53239782%2fuse-encoding-utf-8-in-rio%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
rio::import()
(no captial I) just callsreadxl::read_excel()
for xlsx files. This isread_excel()
's signature:read_excel(path, sheet = NULL, range = NULL, col_names = TRUE, col_types = NULL, na = "", trim_ws = TRUE, skip = 0, n_max = Inf, guess_max = min(1000, n_max))
. It has noencoding
parameter. Take a look at github.com/tidyverse/readxl/issues/125 which was found via a search forr read_excel utf-8
– hrbrmstr
Nov 10 at 14:26
Yes i know the
read_excel
function, but i didn't know that theimport
function just calls it. I will use this then, thank you.– Larsg432
Nov 11 at 10:43
look at the R manual page for
import
. it lists all the functions that it dispatches the actual work to depending on file format.– hrbrmstr
Nov 11 at 10:48