hopefully this shouldn't be a hard one, and I'm just being dense;
Basically I'm downloading species occurrence records using sp_occ in R, for a variety of species across 1 family. I'm still learning so I've just written blocks of code for each species, and intend to merge all the ones which return into 1 big database. However I get a lot of dataframes which don't have any information in, and have a different format because I modify column names etc for the ones which do return.
The end result being , eg, I have 3 dataframes which have the same structure, column names, and the rest are an S3 class object. I'd like to use this:
dfa_all <- rbind(dfa_cal, dfa_can, dfa_ccu, dfa_cki, dfa_cma, dfa_cmi, dfa_cmo, dfa_cno, dfa_cob, dfa_cop, dfa_cru, dfa_csy, dfa_cur, dfa_cze)
to make my final database, but can't merge it because of the different types of data.
I feel like there's a way of using an if/else loop to get this to work, because the main database might update with more occurrence records and I'd love to not have to go back and modify my code if they do update. I'm relatively new to this though and can't figure out how to make that work, any help would be massively appreciated, thank you!
Aucun commentaire:
Enregistrer un commentaire