source("http://bioconductor.org/biocLite.R")
biocLite("rhdf5")
library(rhdf5)
create = h5createFile("example.h5")
getwd()
create=h5createGroup("example.h5","foo")
create=h5createGroup("example.h5","baa")
create=h5createGroup("example.h5","foo/foobaa")
h51s("example.h5")
h5ls("example.h5")
A=matrix(1:10,nr=5,nc=2)
h5write(A,"example.h5","foo/A")
B=array(seq(0.1,2.0,by=0.1),dim=c(5,2,2))
attr(B,"scale")<-"liter"
attr(,"scale")
h5write(B,"example.h5","foo/foobaa/B")
h5ls("example.h5")
df=data.frame(1L:5L,seq(0,1,length.out=5))
df
df=data.frame(1L:5L,seq(0,1,length.out=5),c("ab","cde","fghi","a","s"),stringAsFactors=FALSE)
h5write(df,"example.h5","df")
h51s("example.h5")
h5ls("example.h5")
readA = h5read("example.h5","foo/A")
readB = h5read("example.h5","foo/foobaa/B")
readdf=h5read("example.h5","df")
readA
h5write(c(12,13,14),"example.h5","foo/A",index=list(1:3,1))
h5read("example.h5","foo/A")
hdf5
最新推荐文章于 2024-08-18 03:35:54 发布
2004

被折叠的 条评论
为什么被折叠?



