using as instead of as.data.frame