I'm working in a project and I've the following problem:
I need to structure the data frame of a 1 month period with measures every 1 minute. It makes a column of 43.200 different dates. The thing is that my inputs have some missing data and instead of having always 43.200 measures, they have different sizes like 43.093, 42.928...
I want to replace the NA with the corresponding values, looking for them in the EQUIP variables I already have.
Any ideas of the best way to do it?
This is my first attemp, but is not working properly:
for (i in (1:length(fixed_df$ts))) {
for (j in (1:length(EQUIP1$timestamp)))
if (fixed_df$ts[i] == EQUIP1$timestamp[j]) {
fixed_df$X1[i] <- EQUIP1$power[j]
} else {
fixed_df$X1[i] <- NA
}
}
Thanks!