简体   繁体   English

gzfile(file,“ rb”)中的错误:无效的'description'参数调用自:gzfile(file,“ rb”)

[英]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.

相关问题 gzfile(file, "rb") 出错 - 我该怎么办? - Error in gzfile(file, "rb") - what should I do? ggmap的get_map返回&#39;gzfile中的错误(文件,“rb”):无法打开连接&#39; - ggmap's get_map returns 'Error in gzfile(file, “rb”) : cannot open the connection' gzfile(fname,open =“ rt”)中的错误:无效的&#39;description&#39;参数 - Error in gzfile(fname, open = “rt”) : invalid 'description' argument gzfile(file, "wb") 错误:无法打开连接或压缩文件 - Error in gzfile(file, "wb"): cannot open the connection or compressed file 错误保存:gzfile(文件,“wb”)出错:无法打开连接 - error saving: Error in gzfile(file, “wb”) : cannot open the connection 头(df)gzfile(文件,“wb”)中的错误:无法打开连接 - head(df) Error in gzfile(file, "wb") : cannot open the connection Tax4Fun…gzfile(文件,“ wb”)中的错误:无法打开连接或压缩文件 - Tax4Fun…Error in gzfile(file, “wb”): cannot open the connection or compressed file 代码块内但不在控制台中的 ggplot 错误:gzfile(文件,“wb”)中的警告:无法打开压缩文件? - ggplot error inside code chunks but not in console: Warning in gzfile(file, "wb") : cannot open compressed file? 发布Shiny应用程序时出现gzfile错误 - gzfile error when publishing Shiny app Save.image() 响应 gzfile 中的错误 - Save.image() responds with Error in gzfile
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM