Being a beginner in coding I am unable to export my results from R to Excel. I calculated by SPEI drought index in R after watching some youtube videos but now I want to export them to Excel. Please help me.
then add to a data frame (Data) Data$Spei3 = vals[,1] finally convert to .xlsx format using write_xlsx(Data,"C:\\Users\\erang\\OneDrive\\Desktop\\spei_vals.xlsx")
(here "C:\\Users\\erang\\OneDrive\\Desktop\\spei_vals.xlsx" means the path to save the file and file name)