Load data frame with spanish characters into RStudio on Windows 10
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I have the following data frame (saved as .RData):
Matemáticas <- c(sample(70:100, 10, replace=TRUE))
Química <- c(sample(70:100, 10, replace=TRUE))
notas <- data.frame(Matemáticas,Química)
When loading it to the Global Environment on my Mac, I have no problems. However, when I try to do so in Windows 10 on a PC (RStudio version 3.3.3), the variable names appear as such:
QuÃmica
Matemáticas
I have tried the following things:
1. I have already set the default text encoding to UTF-8 in Tools->Global Options -> Code -> Saving -> Default text encoding.
2. I tried changing the locale, with the following:
Sys.setlocale("LC_ALL",Spanish)
Sys.setlocale("LC_CTYPE",Spanish)
This changed the locale, when I checked with
Sys.getlocale()
but the accents still appeared.
- I tried changing the encoding of the data frame itself with
Encoding(notas) <- "UTF-8"
This did not work because (I suspect) I have to do a sapply or something...
Most of the information I have found online is in reference to reading spanish characters when reading a csv file, but my file is in .RData already.
What I would like is for Windows to ALWAYS recognize spanish accents, as most of my work is in this language.
r utf-8
add a comment |
I have the following data frame (saved as .RData):
Matemáticas <- c(sample(70:100, 10, replace=TRUE))
Química <- c(sample(70:100, 10, replace=TRUE))
notas <- data.frame(Matemáticas,Química)
When loading it to the Global Environment on my Mac, I have no problems. However, when I try to do so in Windows 10 on a PC (RStudio version 3.3.3), the variable names appear as such:
QuÃmica
Matemáticas
I have tried the following things:
1. I have already set the default text encoding to UTF-8 in Tools->Global Options -> Code -> Saving -> Default text encoding.
2. I tried changing the locale, with the following:
Sys.setlocale("LC_ALL",Spanish)
Sys.setlocale("LC_CTYPE",Spanish)
This changed the locale, when I checked with
Sys.getlocale()
but the accents still appeared.
- I tried changing the encoding of the data frame itself with
Encoding(notas) <- "UTF-8"
This did not work because (I suspect) I have to do a sapply or something...
Most of the information I have found online is in reference to reading spanish characters when reading a csv file, but my file is in .RData already.
What I would like is for Windows to ALWAYS recognize spanish accents, as most of my work is in this language.
r utf-8
Can you try to save your df in a csv (on Windows) and then load it (on Mac)?
– Roman
Nov 26 '18 at 20:07
I could, but would prefer a solution with the .RData file...I need it to work on both computers as .RData because its part of a knitr file, so when compiling it I don't wan't an extra step.
– Juliana Gómez
Nov 27 '18 at 17:20
I some cases (esp. OSX <10.10) Rstudio can show characters with wrong encoding, but it sometimes is merely a frontend issue. Can you check if your data is saved properly? (i.e. if it affects the underlying data)
– Roman
Nov 28 '18 at 11:21
But the characters appear ok on my mac, and everything runs smoothly. The problem is only on WIndows on a PC
– Juliana Gómez
Nov 28 '18 at 14:30
add a comment |
I have the following data frame (saved as .RData):
Matemáticas <- c(sample(70:100, 10, replace=TRUE))
Química <- c(sample(70:100, 10, replace=TRUE))
notas <- data.frame(Matemáticas,Química)
When loading it to the Global Environment on my Mac, I have no problems. However, when I try to do so in Windows 10 on a PC (RStudio version 3.3.3), the variable names appear as such:
QuÃmica
Matemáticas
I have tried the following things:
1. I have already set the default text encoding to UTF-8 in Tools->Global Options -> Code -> Saving -> Default text encoding.
2. I tried changing the locale, with the following:
Sys.setlocale("LC_ALL",Spanish)
Sys.setlocale("LC_CTYPE",Spanish)
This changed the locale, when I checked with
Sys.getlocale()
but the accents still appeared.
- I tried changing the encoding of the data frame itself with
Encoding(notas) <- "UTF-8"
This did not work because (I suspect) I have to do a sapply or something...
Most of the information I have found online is in reference to reading spanish characters when reading a csv file, but my file is in .RData already.
What I would like is for Windows to ALWAYS recognize spanish accents, as most of my work is in this language.
r utf-8
I have the following data frame (saved as .RData):
Matemáticas <- c(sample(70:100, 10, replace=TRUE))
Química <- c(sample(70:100, 10, replace=TRUE))
notas <- data.frame(Matemáticas,Química)
When loading it to the Global Environment on my Mac, I have no problems. However, when I try to do so in Windows 10 on a PC (RStudio version 3.3.3), the variable names appear as such:
QuÃmica
Matemáticas
I have tried the following things:
1. I have already set the default text encoding to UTF-8 in Tools->Global Options -> Code -> Saving -> Default text encoding.
2. I tried changing the locale, with the following:
Sys.setlocale("LC_ALL",Spanish)
Sys.setlocale("LC_CTYPE",Spanish)
This changed the locale, when I checked with
Sys.getlocale()
but the accents still appeared.
- I tried changing the encoding of the data frame itself with
Encoding(notas) <- "UTF-8"
This did not work because (I suspect) I have to do a sapply or something...
Most of the information I have found online is in reference to reading spanish characters when reading a csv file, but my file is in .RData already.
What I would like is for Windows to ALWAYS recognize spanish accents, as most of my work is in this language.
r utf-8
r utf-8
edited Nov 28 '18 at 14:31
Juliana Gómez
asked Nov 26 '18 at 18:37
Juliana GómezJuliana Gómez
5516
5516
Can you try to save your df in a csv (on Windows) and then load it (on Mac)?
– Roman
Nov 26 '18 at 20:07
I could, but would prefer a solution with the .RData file...I need it to work on both computers as .RData because its part of a knitr file, so when compiling it I don't wan't an extra step.
– Juliana Gómez
Nov 27 '18 at 17:20
I some cases (esp. OSX <10.10) Rstudio can show characters with wrong encoding, but it sometimes is merely a frontend issue. Can you check if your data is saved properly? (i.e. if it affects the underlying data)
– Roman
Nov 28 '18 at 11:21
But the characters appear ok on my mac, and everything runs smoothly. The problem is only on WIndows on a PC
– Juliana Gómez
Nov 28 '18 at 14:30
add a comment |
Can you try to save your df in a csv (on Windows) and then load it (on Mac)?
– Roman
Nov 26 '18 at 20:07
I could, but would prefer a solution with the .RData file...I need it to work on both computers as .RData because its part of a knitr file, so when compiling it I don't wan't an extra step.
– Juliana Gómez
Nov 27 '18 at 17:20
I some cases (esp. OSX <10.10) Rstudio can show characters with wrong encoding, but it sometimes is merely a frontend issue. Can you check if your data is saved properly? (i.e. if it affects the underlying data)
– Roman
Nov 28 '18 at 11:21
But the characters appear ok on my mac, and everything runs smoothly. The problem is only on WIndows on a PC
– Juliana Gómez
Nov 28 '18 at 14:30
Can you try to save your df in a csv (on Windows) and then load it (on Mac)?
– Roman
Nov 26 '18 at 20:07
Can you try to save your df in a csv (on Windows) and then load it (on Mac)?
– Roman
Nov 26 '18 at 20:07
I could, but would prefer a solution with the .RData file...I need it to work on both computers as .RData because its part of a knitr file, so when compiling it I don't wan't an extra step.
– Juliana Gómez
Nov 27 '18 at 17:20
I could, but would prefer a solution with the .RData file...I need it to work on both computers as .RData because its part of a knitr file, so when compiling it I don't wan't an extra step.
– Juliana Gómez
Nov 27 '18 at 17:20
I some cases (esp. OSX <10.10) Rstudio can show characters with wrong encoding, but it sometimes is merely a frontend issue. Can you check if your data is saved properly? (i.e. if it affects the underlying data)
– Roman
Nov 28 '18 at 11:21
I some cases (esp. OSX <10.10) Rstudio can show characters with wrong encoding, but it sometimes is merely a frontend issue. Can you check if your data is saved properly? (i.e. if it affects the underlying data)
– Roman
Nov 28 '18 at 11:21
But the characters appear ok on my mac, and everything runs smoothly. The problem is only on WIndows on a PC
– Juliana Gómez
Nov 28 '18 at 14:30
But the characters appear ok on my mac, and everything runs smoothly. The problem is only on WIndows on a PC
– Juliana Gómez
Nov 28 '18 at 14:30
add a comment |
0
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%2f53487127%2fload-data-frame-with-spanish-characters-into-rstudio-on-windows-10%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
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.
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%2f53487127%2fload-data-frame-with-spanish-characters-into-rstudio-on-windows-10%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
Can you try to save your df in a csv (on Windows) and then load it (on Mac)?
– Roman
Nov 26 '18 at 20:07
I could, but would prefer a solution with the .RData file...I need it to work on both computers as .RData because its part of a knitr file, so when compiling it I don't wan't an extra step.
– Juliana Gómez
Nov 27 '18 at 17:20
I some cases (esp. OSX <10.10) Rstudio can show characters with wrong encoding, but it sometimes is merely a frontend issue. Can you check if your data is saved properly? (i.e. if it affects the underlying data)
– Roman
Nov 28 '18 at 11:21
But the characters appear ok on my mac, and everything runs smoothly. The problem is only on WIndows on a PC
– Juliana Gómez
Nov 28 '18 at 14:30