R在打开netcdf文件时崩溃

编程入门 行业动态 更新时间:2024-10-25 13:13:52
本文介绍了R在打开netcdf文件时崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我下载了一个netcdf文件,并尝试在R中打开它。以下是我的代码

download.file("data.giss.nasa.gov/impacts/agmipcf/agmerra/AgMERRA_1980_prate.nc4",destfile = "AgMERRA_1980_prate.nc4", method="libcurl")

我要使用R

打开netcdf文件 library(ncdf4) my.file <- nc_open("AgMERRA_1980_prate.nc4")

但是,每次我这样做时,R都会崩溃。

是我的代码有问题,还是R Studio有问题?

essionInfo() R版本3.5.0(2018-04-23) 平台:x86_64-w64-mingw32/x64(64位) 运行环境:Windows 7 x64(内部版本号7601)Service Pack 1

矩阵产品:默认

编辑

如果我手动下载该文件,则可以打开它。所以我下载它的方式一定有什么问题。有什么建议吗?

推荐答案

我不确定这里发生了什么,可能是Windows特定的。我尝试在没有参数的情况下下载method="libcurl",它似乎起作用了。

download.file("data.giss.nasa.gov/impacts/agmipcf/agmerra/AgMERRA_1980_prate.nc4", destfile = "AgMERRA_1980_prate.nc4") library(ncdf4) my.file <- nc_open("AgMERRA_1980_prate.nc4") File AgMERRA_1980_prate.nc4 (NC_FORMAT_NETCDF4): 1 variables (excluding dimension variables): short prate[longitude,latitude,time] (Chunking: [1440,720,1]) (Compression: level 9) _FillValue: 32767 description: Precipitation Rate units: mm/day add_offset: 0 scale_factor: 0.100000001490116 vMin_original_data: 0 vMax_original_data: 457.399993896484 vRange: 457.399993896484 3 dimensions: time Size:366 *** is unlimited *** units: days since 1980 01-01-01 12:00:00 latitude Size:720 units: degrees_north longitude Size:1440 units: degrees_east 4 global attributes: history: Tue Aug 12 16:42:13 EDT 2014 source: AgMIP / Alex Ruane title: AgMERRA v1.1 Precipitation Rate center: NASA GISS

我的会话信息-

R version 3.5.0 (2018-04-23) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS High Sierra 10.13.6

更多推荐

R在打开netcdf文件时崩溃

本文发布于:2023-11-17 07:34:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1609317.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   netcdf

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!