I have datasets in .nc format. I imported them in R as rasters but they appear as lateral inversions (see image below). [![NC data as raster][1]][1] I tried changing the orientation and inversion with the codes below but none worked as the results are all laterally inverted. In ArcMap, one can use the mirror feature tool to correct the lateral inversion. Is there a way to do something similar to mirroring features in R? f <- list.files(path=".", pattern='nc$', full.names=TRUE) s <- stack(raster(f)) P <- t(flip(s, direction='x')) P2 <- t(flip(s, direction='y')) The resulting images for P and P2 are shown below. [![Image for P][2]][2] [![Image for P2][3]][3] [1]: https://i.sstatic.net/G6Vov.jpg [2]: https://i.sstatic.net/Z7hO7.jpg [3]: https://i.sstatic.net/Ah99T.jpg