統合しようとしたときの長さが異なる(しかし、長さが同じである):エラー - 私はデータを持っている
Date Value
17/12/17 8:39:45 1144.5783
17/12/17 8:40:02 1646.5863
17/12/17 8:40:15 1104.4177
17/12/17 8:40:30 1244.9799
17/12/17 8:40:45 1084.3373
17/12/17 8:41:00 1285.1406
17/12/17 8:41:15 1144.5783
17/12/17 8:41:30 1124498
17/12/17 8:41:45 1265.0602
17/12/17 8:42:00 1124498
17/12/17 8:42:15 1144.5783
17/12/17 8:42:30 1164.6586
17/12/17 8:42:45 1084.3373
17/12/17 8:43:00 1184739
17/12/17 8:43:15 1064257
17/12/17 8:43:30 1164.6586
17/12/17 8:43:45 1184739
17/12/17 8:44:00 1244.9799
私は日中に積分を計算します。 私の実際のデータは3124行から成っています。
Error in xy.coords(x, y, setLab= FALSE): 'x' and 'y' lengths differ
が、長さは同じです:私はRESを実行しようとすると
library(lubridate)
library(MESS)
thedata <- read.csv('data.csv')
datetime <- dmy_hms(as.character(thedata$Date))
time_length_data <- time_length(interval(datetime[1] , datetime[18]), "second")
# data is gathered by almost every 15 sec
divide_data <- 1:(time_length_data/15)
# I am ommiting a few rows in order to have the same length as "sec" matrix below.
divide_data <- divide_data[1:18]
# this contains the values and has length 18
sec <- as.numeric(as.matrix(thedata[2]))
res <- auc(divide_data, sec, from = min(divide_data), to = max(divide_data), type = 'spline', absolutearea = TRUE)
、それは私を与えます。
小さなサブサンプルに基づいて質問を更新できますか?あなたの実際のデータは3124行で忘れてしまいます。 –
あなたの 'auc'関数はどこにありますか? – kath
私はあなたの 'auc'が' MESS'からのものだと仮定していますが、あなたの例にそれを含めるべきです。 – Eumenedies