문제
HDF5를 R에로드하고 몇 가지 문제를 해결하려고합니다. 환경을 구성하기 위해 취한 단계는 다음과 같습니다.
- Mac OS X 10.6에서 R 2.10.0 (x64)
- HDF5 1.8.3 Macports를 통해 설치
- 크랜에서 HDF5_1.6.9.tar.gz
HDF5 버전의 비 호환성과 R 모듈이 기대하는 문제와 관련된 문제가 의심됩니다. 완전성을 위해 여기에는 r 모듈을 설치 한 방법이 있습니다.
r CMD 설치--configure-vars = 'cppflags = -i/opt/local/includ'---configure-args = '-with-hdf5 =/opt/local'hdf5_1.6.9.tar.gz
이것은 괜찮습니다. 라이브러리는 문제없이로드되는 것처럼 보이지만 파일을로드하려고 할 때 데이터는 반환되지 않습니다.
도서관 (HDF5)
hdf5load ( "test.h5")
없는
아직,
OSX : Data Scott $ h5dump test.h5 hdf5 "test.h5"{group " /"{dataSet "dset"{datatype h5t_std_i32le dataspace simple {(31) / (31)} data {(0) : 1, 2, 4 , 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, (14) : 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, (22) : 4194304, 83886008 , 16777216, 33554432, 67108864, 134217728, (28) : 268435456, 536870912, 1073741824}}}}
이견있는 사람?
미리 감사드립니다.
해결책
사용 verbosity
인수 hdfload()
그리고 당신의 환경을 사용하여 확인하십시오 ls()
. hdfload()
부작용이 있고 테이블을 현재 환경에로드하고 NULL
기본 반환 값입니다. 인수를 사용하는 경우 load=TRUE
객체는 명명 된 목록의 구성 요소로 반환됩니다.
load
: 논리적 가치. 'false'인 경우 객체는 명명 된 목록의 구성 요소로 반환됩니다. 'true'(기본값) 인 경우 객체는 자체 이름을 가진 개별 변수로로드됩니다.이 경우 함수는 아무것도 반환하지 않습니다.
내 Mac에서는 모든 것이 동일한 설정과 잘 어울립니다.
R> rm(list=ls())
R> ls()
character(0)
R> hdf5load("TestHDF5.h5", verbosity=3)
hdf5_global_verbosity=3 load=1
Processing object: Dataset0 ...... its a dataset...Dataset has ID335544326
Dataset has tid 201326902
Dataset has space id 268435467
Dataset has rank 1
Dataset has dims/maxdims: 1 / 1
Allocating vector with rank=1 dim=1
calling vector_io. Hangs here with big datsets
Setting buffer size in plist
About to read with bufsize = 50
in string_ref: count=1, size=25 srcbf=25
leaving string_ref
Done read
in vector_io: permuting
in vector_io: tidying
Phew. Done it. calling iinfo->add
Rank > 1 or not VECSXP
Calling hdf5_load_attributes
back from hdf5_load_attributes
...Finished dataset
Processing object: Table0 ...... its a dataset...Dataset has ID335544327
Dataset has tid 201326906
Dataset has space id 268435468
Dataset has rank 1
Dataset has dims/maxdims: 1 / 1
Dataset has type = VECSXP and rank 1
Reading...
....done
in string_ref: count=1, size=25 srcbf=25
leaving string_ref
...Finished dataset
NULL
R> ls()
[1] "Dataset0" "Table0"
다른 팁
CRAN에서 H5R 패키지를 사용해 볼 수도 있습니다. 이 패키지는 새로운 HDF5 라이브러리를 사용하며 HDF5 라이브러리보다 더 많은 기능을 제공합니다.