[英]Error in gzfile(file, “rb”) : invalid 'description' argument Called from: gzfile(file, “rb”)
I have a problem with a function I have made trying to map some columns with config file I have made. 我在尝试使用我制作的配置文件映射某些列时遇到了一个函数问题。 I am running the function yet I get the error:
我正在运行该功能,但出现错误:
Error in gzfile(file, "rb") : invalid 'description' argument Called from: gzfile(file, "rb")
I have looked online, including stack overflow and do not get a proper answer to this question. 我在网上看过,包括堆栈溢出,但没有得到正确的答案。 Would you please help?
你能帮忙吗? This functions I have made works well on another machine but as I tried to deploy my work onto my personal laptop, it seems I get this error.
我已经使该功能在另一台机器上运行良好,但是当我尝试将工作部署到个人笔记本电脑上时,似乎出现了此错误。
This is what I am attempting to do in Mac: 这是我在Mac中尝试做的事情:
Thinking of the the path is set to this: 思考路径设置为:
data_import_list <- list(list(data_path = "Users/gb/Rprojects/data/data.csv",
config_path = "Users/gb/Rprojects/lgt-config/inp/"))
And then I read it with the function 然后我用功能阅读
import_col_types <- function(config_path){
column_mapping <- readRDS(file.path(config_path, "column_mapping.rds"))
# get list of config files
config_file_list <- Sys.glob(paste0(config_path, "*.rds"))
}
Actually this is how I read with the above function: 实际上,这就是我使用上述功能阅读的方式:
import_col_types(data_import_list)
Print out file
before the error. 在错误之前打印出
file
。 Check it is what you think it is. 检查它是您所认为的。 I can replicate your error message with:
我可以使用以下方式复制您的错误消息:
> gzfile(1,"rb")
Error in gzfile(1, "rb") : invalid 'description' argument
> gzfile(NA,"rb")
Error in gzfile(NA, "rb") : invalid 'description' argument
> gzfile(NULL,"rb")
Error in gzfile(NULL, "rb") : invalid 'description' argument
but not: 但不是:
> gzfile("nonexist","rb")
Error in gzfile("nonexist", "rb") : cannot open the connection
In addition: Warning message:
In gzfile("nonexist", "rb") :
cannot open compressed file 'nonexist', probable reason 'No such file or directory'
so it looks like your file
is broken. 因此看来您的
file
已损坏。 No way we can see what it is, so you need to debug this yourself. 我们无法看到它是什么,因此您需要自己调试。 Basic debugging.
基本调试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.