Commit 1fae5830 authored by Heraut Louis's avatar Heraut Louis
Browse files

Datasheet date type

parent 16dde0c7
No related merge requests found
Showing with 22 additions and 3 deletions
+22 -3
......@@ -145,7 +145,7 @@ prepare_date = function(df_XEx, df_Xlist) {
# }
# df_XEx$values = dateExJul
dateStart_group = summarise(group_by(df_Xlist$data, group),
Date = min(Date))
# filter(group_by(df_Xlist$data, group), Date == min(Date))
......@@ -166,8 +166,27 @@ prepare_date = function(df_XEx, df_Xlist) {
OkdateStart_group = dateStart_group$group == group
Shift = dateStart_group$Date_julian[OkdateStart_group]
year = dateStart_group$Year[OkdateStart_group]
OkXEx = df_XEx$group1 == group & df_XEx$datetime == year
df_XEx$values[OkXEx] = df_XEx$values[OkXEx] + Shift
OkXEx_code_year = df_XEx$group1 == group & df_XEx$datetime == year
df_XEx$values[OkXEx_code_year] =
df_XEx$values[OkXEx_code_year] + Shift
OkXEx_code = df_XEx$group1 == group
XEx_code = df_XEx$values[OkXEx_code]
# dXExUp = abs(XEx_code - c(XEx_code[2:length(XEx_code)],
# XEx_code[length(XEx_code)]))
# dXExDown = abs(XEx_code - c(XEx_code[1],
# XEx_code[1:(length(XEx_code) - 1)]))
# dExMean = apply(rbind(dXExUp, dXExDown), 2, mean, na.rm=TRUE)
meanXEx_code = mean(XEx_code, na.rm=TRUE)
dXEx_code = abs(XEx_code - meanXEx_code)
stdXEx_code = sd(XEx_code, na.rm=TRUE)
print(stdXEx_code*2)
print(dXEx_code)
XEx_code[dXEx_code >= 365/3] = XEx_code[dXEx_code >= 365/3] + 365
# df_XEx$values[OkXEx_code] = XEx_code
}
return (df_XEx)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment