You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The AFLW example from the UseR! talk and working paper no longer runs. The code for the example is below.
library(fitzRoy)
library(dplyr)
library(interp)
library(cassowaryr)
# Get data and find scatter plot that is instant and long scatter plot
aflw <- fetch_player_stats(2020, comp = "AFLW")
aflw_num <- aflw %>%
select_if(is.numeric)
aflw_num <- aggregate(aflw_num[,5:37],
list(aflw$player.player.player.surname),
mean)
#This calculation used in the paper and package will take an estimated 4h and return an error after 30mins
AFLW_scags <- calc_scags_wide(aflw_num[,c(2:34)])
There are two issues with this calculation.
The computation time has been increased from approximately 12 minutes to 4 hours. This is due to a handful of plots that were previously instantaneous when calculated under tripack now taking over a minute each. There isn't a clear visual feature that is causing this issue and the only way to find out a plot has a large number of edges is to run the Delaney triangulation. Tracing back the source of the sudden increase of time we have:
cassowary::scree > alphahull::delvor > interp::tri.mesh > interp:::shull.deltri
The function interp::tri.mesh is a replacement for tripack::trimesh (this is where the packages differ) BUT inerp::shell.dultri isn’t written with R code, it is a wrapper for a function in C++. Therefore, even though the shull library is open source, it being written in C++ makes these errors hard to fix. An example of a scatter plot that was previously instantaneous and now takes over a minute is below.
# three vectors (one is problems)
a <- aflw_num$goals
b <- aflw_num$behinds
c <- aflw_num$handballs
# a,b is fast, a,c is slow (1.5mins)
# get ac to shull input
#inside cassowaryr::scree()
ac <- cbind(cassowaryr:::unitize(a), cassowaryr:::unitize(c))
dupes <- paste(a, c, sep =",")
ac <- ac[!duplicated(dupes),]
#inside alphahull::delvor()
y=NULL
AC <- xy.coords(ac, y)
tri.obj1 <- interp::tri.mesh(AC) #1min 20seconds
tri.obj2 <- tripack::tri.mesh(AC) #instantaneous
There is an "error counting arcs" that I cannot preemptively check for that was not returned with tripack.
# Scatter plot that throws an error
d <- aflw_num$totalPossessions
e <- aflw_num$contestedPossessions
scree(d,e) # returns an error from the shull.deltri function
Since the error comes from the C++ code, I can't debug it.
The text was updated successfully, but these errors were encountered:
The AFLW example from the UseR! talk and working paper no longer runs. The code for the example is below.
There are two issues with this calculation.
cassowary::scree > alphahull::delvor > interp::tri.mesh > interp:::shull.deltri
The function interp::tri.mesh is a replacement for tripack::trimesh (this is where the packages differ) BUT inerp::shell.dultri isn’t written with R code, it is a wrapper for a function in C++. Therefore, even though the shull library is open source, it being written in C++ makes these errors hard to fix. An example of a scatter plot that was previously instantaneous and now takes over a minute is below.
Since the error comes from the C++ code, I can't debug it.
The text was updated successfully, but these errors were encountered: