See lapply
:
library(rhdf5)
files <- list.files(pattern = ".he5", full.names = TRUE)
attribute <- "/HDFEOS/SWATHS/ColumnAmountNO2/Data Fields/ColumnAmountNO2Trop"
out.list <- lapply(files, h5read, attribute)
This will store all the read objects into a single object: a list. It is the preferred approach versus creating as many objects as you have files.