Hello
i have a dataset like:
Datum Region Betrag Betragin Betragout Diff group
1 2014.10.15 america 2146733 2146733 0.0 2146733 1
2 2014.10.15 Africa -322394 0 -322400.0 -322400 1
3 2014.10.15 asia 1231273 6621332 -5390074.6 1231257 1
4 2014.10.15 Spain -2255851 2719620 -4975470.0 -2255850 1
5 2014.10.15 Swiss 1961510 2861038 -899528.3 1961510 1
6 2014.10.15 Australia -1166936 3261793 -4428733.0 -1166940 1
names(dataset) <- c("Datum", "Region", "Betrag", "Betragin", "Betragout", "Diff") #Rename
dataset$group <- c(1)
dataset[is.na(dataset)] = 0
ds_out<-as.numeric(rbind(df$Betragout)) #vectorization
ds_in <- as.numeric(rbind(df$Betragin)) #vectorization
ggplot(dataset)+
geom_bar(mapping = aes(x=substr(Datum,start=1,stop=8), y=Betragin/1000000, fill="Betragin/1000000"), stat="identity",, width=0.8)+
geom_bar(mapping= aes(x=substr(Datum,start=1,stop=8), y=Betragout/1000000, fill="Betragout/1000000"), stat="identity", width=0.8)+
geom_point(mapping= aes(x=substr(Datum,start=1,stop=8), y=Diff/1000000, group=group, fill="Diff/1000000"), color="NA", size=1) +
geom_line(mapping= aes(x=substr(Datum,start=1,stop=8), y=Diff/1000000, group=group, fill="Diff/1000000"), color="#666666", size=1)+
theme_gray(base_size=12)+
labs(x="",y="CHF in Mio.")+
ifelse(ds_in/1000000<1 | ds_out/1000000>-1, #check if value is lager or smaller than 1, if yes, do scaling by 0.05, if no, by 0.5
scale_y_continuous(breaks = seq(-100000,100000, by=0.05)),
scale_y_continuous(breaks = seq(-100000,100000, by=0.5), minor_breaks=seq(-100000,100000, by=0.1))
then i get the error
Fehler in rep(yes, length.out = len) :
attempt to replicate an object of type 'environment'
what does this mean? and how can i fix this?
thanks