Thank you, but unfortunately the issue seems to be somewhere else. I took fn5 out of nested functions and this is how it currently stands:
fn5 <- function(Tracker, country, os){
if (os == "android"){
column <- which(Trackers == Tracker) + 1
} else {column <- which(Trackers == Tracker) + 1 + length(Trackers) + 2}
y <- which(countries == country)
print(y)
if (y == 1){as.numeric(gsub(",",".", gsub("\\ €", "", unlist(data2[2:(2 + (days_in_month(date)[[1]])), column][[1]]))))
} else {as.numeric(gsub(",",".", gsub("\\ €", "", unlist(data2[((2+((days_in_month(date)[[1]])+ 4)*(y-1))):(2+((days_in_month(date)[[1]])+ 4)*(y-1)+days_in_month(date)[[1]]), column][[1]]))))
}
}
`costdata_Soll-Ausg.` <- pmap(list(all_variables$Tracker, all_variables$Country, all_variables$`OS Name`), fn5)
It works perfectly fine in RStudio, but not with RGui. data2 is a dataframe with columns as character strings. The issue is that instead of numeric output it procudes NA-s in RGui. Funnily enough if i susbstitute "column" and " y" with values it does produces requested output. Sourcing the code produces NA-s only.