facet_grid 问题:输入字符串 1 在此区域设置中无效?

发布于 2024-09-15 18:35:13 字数 361 浏览 3 评论 0原文

我正在尝试使用以下代码创建构面网格

p <- ggplot(melted,aes(factor(country))) + geom_bar() +opts(axis.text.x =   theme_text(angle = 90,hjust = 1)) 

p + facet_grid(. ~ provider)

,但总是收到以下错误:

Error in sub("^[^:]+: ([^\n]+)\n[0-9]+:(。 *)$", "\1\2", expr) : 输入字符串 1 在此区域设置中无效

我不知道我做错了什么。还尝试考虑我的方面,但这也不起作用。

提前谢谢!

I am trying to create facet grid with the following code

p <- ggplot(melted,aes(factor(country))) + geom_bar() +opts(axis.text.x =   theme_text(angle = 90,hjust = 1)) 

p + facet_grid(. ~ provider)

but I always get the following error:

Error in sub("^[^:]+: ([^\n]+)\n[0-9]+:(.*)$", "\1\2", expr) :
input string 1 is invalid in this locale

I do not have any idea what I am doing wrong. also tried to factor my facet, which doesn't work either.

Thx in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沉默的熊 2024-09-22 18:35:13

我自己解决了这个问题。这是解决方案。我的区域设置设置为
1 "de_DE.UTF-8/de_DE.UTF-8 /C/C/de_DE.UTF-8/de_DE.UTF-8”

检查过

Sys.getlocale()

,我根据 bioconductor 邮件列表,区域设置应设置为 C。这就是我所做的

Sys.setlocale(locale="C")

,瞧,分面工作就像以前一样。我不知道区域设置是如何更改的,但这就是每当出现此问题时您可以更改它的方法。

HTH还有其他人。

I fixed this one on my own. Here's the solution. My locale was set to
1 "de_DE.UTF-8/de_DE.UTF-8/C/C/de_DE.UTF-8/de_DE.UTF-8"

which I checked with

Sys.getlocale()

According to the bioconductor mailinglist, locale should be set to C. This is what I did

Sys.setlocale(locale="C")

Et voilà the faceting worked just like it used to. I have no clue how the locale changed, but that's how you can change it whenever this problem occurs.

HTH someone else too.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文