Я загрузил файл «h5ex_t_string.h5» в случайном порядке от here для использования в качестве примера.
Способ чтения файла .h5 является следующее:
library(rhdf5) #load library
h5ls("h5ex_t_string.h5") #this will show you the name to use below in the argument
> h5ls("h5ex_t_string.h5")
group name otype dclass dim
0 /DS1 H5I_DATASET STRING 4 #so the name is DS1
D = h5read("h5ex_t_string.h5",name='DS1') #use the filename and the name to read file
> D #Weird message in the file but I randomly downloaded it
[1] "Parting" "is such" "sweet " "sorrow."
Функция h5read возвращает массив, который затем можно преобразовать в data.frame, если Вам нравится
> a<-data.frame(D)
> a
D
1 Parting
2 is such
3 sweet
4 sorrow.