问题描述
我有一个数据框,其中包含事件A的开始时间和事件A的时长(以小时为单位)的列,例如:
df = structure(list(StartTime = c(10.1401724605821,8.34114734060131,10.1930766354781,9.49644518946297,9.36002452136017,10.8311833878979,9.44229844841175,8.48090101312846,9.31779155065306,9.57179348240606
),Length = c(3.28013235144317,3.97817114274949,4.29317499510944,2.63135516550392,3.49188423063606,4.08827690966427,3.63062007538974,3.82309223059565,1.52407871372998,1.80725628975779)),row.names = c(NA,-10L),class = c("tbl_df","tbl","data.frame"))
实际上,df包含数千条记录。 我想计算进行中事件的数量的密度(或直方图-但密度在每个时间增量中都有很多事件,因此更有意义)。 因此,例如,在某个事件从8.02开始并花费1个小时的情况下,则该记录将对正在进行的操作进行计数,分别为8.03、8.04 ... 9.02。每条记录同样贡献了很多次。
解决此问题的最佳方法是什么?
解决方法
这是一个GetCountriesWithRetry
GetAndRetry
RetryWithTimeout
ProcessGetRequest
ProcessGetRequest - !response.IsSuccessStatusCode
RetryWithTimeout - onRetryInner #1 due to exception 'No success status code InternalServerError'
ProcessGetRequest
ProcessGetRequest - !response.IsSuccessStatusCode
RetryWithTimeout - onRetryInner #2 due to exception 'No success status code InternalServerError'
LoadCountriesWithRetry - TimeoutRejectedException : The delegate executed asynchronously through TimeoutPolicy did not complete within the timeout.
解决方案:
tidyverse
由reprex package(v0.3.0)于2020-10-16创建