0

I have been trying to split my raster list (for a month) into a list with 2 elements or two separate lists depending on extent/tile number in the MODIS name. I can't seem to get any split function to work. The files look like this: List of rasters

As you can see, the grid names are there in the names slot and the extents are different. Is there a way I can split them so I can write a function to go through each pair and merge/mosaic them?

Thank you

  • attach the code with the post. please don't post as an image – Kiran Maniya Sep 30 '19 at 21:54
  • @Julia Welcome to SO. In addition to adding the minimal script, please have a look at [here](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) so that you can make a minimal reproducible example. Then it will be much easier to help you. – Majid Sep 30 '19 at 23:23

1 Answers1

1

With list x, start with

n <- sapply(x, names)

To get the names. To help you further, make a vector of a few example names, like

n <- c("mod10Axyz", "mod10Bxy", "mod10Aabc")

and edit your question.

Robert Hijmans
  • 40,301
  • 4
  • 55
  • 63