gpt4 book ai didi

r - Rscript.exe 中包含 Unicode 字符的文件路径

转载 作者:行者123 更新时间:2023-12-02 02:32:24 24 4
gpt4 key购买 nike

我正在尝试将 SVG 图像保存到包含 Unicode 字符的文件路径。例如:

n = c(2, 3, 5)
s = c("aa", "bb", "cc")
b = c(TRUE, FALSE, TRUE)
df = data.frame(n, s, b)

svg("c:/נועם/plots.svg")
plot(df)
dev.off()

使用 Rscript.exe 运行失败并出现以下错误:

Error in plot.new() : cairo error 'error while writing to output stream'

我怎样才能让它发挥作用?

最佳答案

您可以将工作目录设置为希伯来语名称的目录,而不是保存 svg 文件。请看下面的代码:

n <- c(2, 3, 5)
s <- c("aa", "bb", "cc")
b <- c(TRUE, FALSE, TRUE)
df <- data.frame(n, s, b)
setwd("C:\\נועם\\")
svg("plots.svg")
plot(df)
dev.off()

关于r - Rscript.exe 中包含 Unicode 字符的文件路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34629262/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com