You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用openair包trajCluster函数报错:参数'x'缺失且无默认值

求助:openair包trajCluster函数运行报错问题

各位大佬好,我最近在使用openair包做轨迹聚类分析,之前一直能正常运行的代码,现在突然报错了,实在摸不着头脑,想请大家帮忙排查下问题。

1. 轨迹数据读取代码

我先通过以下代码读取轨迹数据:

traj_2010 <- read.csv("C:/Users/stieger/Trajektorien/traj_10.csv", header=TRUE) 
traj_2010$date <- as.POSIXct(strptime(traj_2010$date, format="%Y-%m-%d %H:%M", "GMT")) 
traj_2010$date2 <- as.POSIXct(strptime(traj_2010$date2, format="%Y-%m-%d %H:%M", "GMT"))

2. 数据结构预览

读取后的数据结构如下(展示前6行):

head(traj_2010)

输出结果:

receptor year month day hour hour.inc   lat    lon height pressure               date2       date
1        1   10     1   1    0        0 51.33 12.420  500.0    912.2 2010-01-01 00:00:00 2010-01-01
2        1    9    12  31   23       -1 51.35 12.523  464.1    915.2 2009-12-31 23:00:00 2010-01-01
3        1    9    12  31   22       -2 51.35 12.668  422.2    919.4 2009-12-31 22:00:00 2010-01-01
4        1    9    12  31   21       -3 51.33 12.840  380.9    922.0 2009-12-31 21:00:00 2010-01-01
5        1    9    12  31   20       -4 51.28 13.029  351.5    923.6 2009-12-31 20:00:00 2010-01-01
6        1    9    12  31   19       -5 51.22 13.240  335.1    924.2 2009-12-31 19:00:00 2010-01-01

3. 聚类函数调用

接着我调用trajCluster函数进行聚类:

cluster_2010 <- trajCluster(traj_2010, method = "Angle", n.cluster = 5, 
                            col = c("red2", "blue", "green3", "purple", "black"), 
                            map.fill= FALSE, key=FALSE, main="2010", 
                            xlab="latitude", ylab="longitude", 
                            xlim=range(-35:35), ylim=range(35:70), 
                            par.settings=list(axis.line=list(lwd=1.5), 
                                              strip.border=list(lwd=2), 
                                              fontsize=list(text=32)))

4. 报错信息

函数运行了几分钟后,进度条到100%时突然报错,错误信息如下:

|==============================================================================|100% ~0 s remaining 
Error in summarise_impl(.data, dots) : 
  Evaluation error: argument "x" is missing, with no default.

5. 当前加载的R包

我当前加载的包包括:

library(openair) 
library(plyr) 
library(reshape2) 
library(mapdata) 
library(rworldmap) 
library(dplyr)

这段代码之前是可以正常运行出结果的,现在不知道哪里出了问题,有没有熟悉openair包的朋友能帮忙分析下原因?

内容的提问来源于stack exchange,提问作者user9871061

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 08:22:10