I am currently new to the field of species distribution modelling and am in the process of preparing data on the 19 bioclimatic variables, downloaded from worldclim, for Europe to use in the maxent modelling software. I acquired the data as a spatial raster and attempted to convert each layer in the spatial raster (corresponding to each of the bioclim variables) into individual ascii files as follows:
#Downloading the climate data from worldclim for the whole globe
bioclim_2.5.world.1970to2000 <- geodata::worldclim_global(var = 'bio', res = 2.5, download = T, path = "Worldclim_bio_2.5")
#Cropping the bioclim data for study area
Europe.extent <- ext(-24, 69, 35, 82)
bioclim_2.5.Europe.1970to2000 <- crop(bioclim_2.5.world.1970to2000, Europe.extent)
#Putting saved data into ascii format for maxent software
names(bioclim_2.5.Europe.1970to2000)
[1] "wc2.1_2.5m_bio_1" "wc2.1_2.5m_bio_2" "wc2.1_2.5m_bio_3"
[4] "wc2.1_2.5m_bio_4" "wc2.1_2.5m_bio_5" "wc2.1_2.5m_bio_6"
[7] "wc2.1_2.5m_bio_7" "wc2.1_2.5m_bio_8" "wc2.1_2.5m_bio_9"
[10] "wc2.1_2.5m_bio_10" "wc2.1_2.5m_bio_11" "wc2.1_2.5m_bio_12"
[13] "wc2.1_2.5m_bio_13" "wc2.1_2.5m_bio_14" "wc2.1_2.5m_bio_15"
[16] "wc2.1_2.5m_bio_16" "wc2.1_2.5m_bio_17" "wc2.1_2.5m_bio_18"
[19] "wc2.1_2.5m_bio_19"
writeRaster(stack(bioclim_2.5.Europe.1970to2000), filename=names(bioclim_2.5.Europe.1970to2000), bylayer=TRUE, format="ascii", overwrite = TRUE)
When I try to run the last bit of code it generates an ascii file for the first bio clim variable (wc2.1_2.5m_bio_1) however I then get the following error and no other ascii files are generated.
Error in options(scipen = opsci) : invalid 'scipen'
Does anyone know why this error occurs or why it only seems to generate an ascii file of the first layer.