library(terra)
fpath <- system.file("extdata", "condordem.RDS", package="mkde")
condordem <- terra::readRDS(fpath)
# Save as XDMF (notice no file extension in file name)
writeRasterToXDMF(condordem, "condor_dem")
# Clean up files
unlink("condor_dem.dat")
unlink("condor_dem.xdmf")
Run the code above in your browser using DataLab