I have this data about PM10 concentrations in Germany. It can be downloaded at this [link] (https://www.umweltbundesamt.de/sites/default/files/medien/4640/dokumente/pm10_2019_0.xlsx)
In excel it looks more or less like this:
This problem here is, that for each of the 16 states there is "joined" one row and until the next row of that kind there are the individual stations that measure the PM10 concentration. What I would like to do now is to create a new column for each state each assign the name of the state to each measurement.
I honestly have no clue how to do that in R. I imagine that there might be some workarround with somethin in pseudocode like
state = None
for each row:
if (NA in Statiocode):
state = Name
else:
new_col = state
Does this look like some kind of right approach?
