繁体   English   中英

特殊字符问题? utf8towcs 错误。 如何解决?

[英]Special characters problem? utf8towcs error. How to fix it?

我不知道脚本发生了什么。

前几天工作。 但是今天不要显示图表,只给我这个错误代码:

Warning messages:
1: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y,  :
  invalid input 'Aín' in 'utf8towcs'
2: In grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y,  :
  invalid input 'Aín' in 'utf8towcs'


"Aín" its a town in the .csv   I don´t know how to fix this....

这是代码:

library(tidyverse)

library('data.table') 




dfcsv <- read.csv("https://dadesobertes.gva.es/dataset/15810be9-d797-4bf3-b37c-4c922bee8ef8/resource/8ab99a46-1d04-42b4-8ee4-0cc5821be976/download/2020-06-05_casospormunicipio.csv", encoding = "UTF-8", header = TRUE, sep = ";")
colnames(dfcsv) <- c("code","Municipio", "PCR", "Tasa PCR", "PCR14", "Tasa PCR14", "Muertos", "Tasa Muertos")


dfcsv %>%
  mutate(Municipio = fct_reorder(Municipio, PCR)) %>%


  ggplot(aes(x=Municipio, y=PCR)) +
  geom_bar(stat="identity", width=0.6) + coord_flip() 

在此处输入图像描述

将编码更改为 ASCII 有效。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM