Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • CSTools CSTools
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 28
    • Issues 28
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • External
  • CSToolsCSTools
  • Issues
  • #105
Closed
Open
Issue created Nov 03, 2022 by aho@ahoMaintainer

CST_Analogs: Subset() returns errors

Hi @erifarov

(1) There is a bug in CST_Analogs.R. At line855 (and the similar parts in other if conditions), which(names(dim(obslocal)) == 'time') should be which(names(dim(obslocal$data)) == 'time') since obslocal is a list. It didn't return error with the old Subset(), but now it shows an error

Error in Subset(obslocal$data, along = which(names(dim(obslocal)) == "time"), : Parameter 'indices' should be a list.

Note that the error message is not precise so I need to improve it, but it's not the main concern in this issue. The problem can be reproduced by example 8 in Analogs().

(2) Aside from the "new" error message, this Subset() part didn't work with the previous Subset(). Because along is empty, Subset() returned the same array without subsetting it. So the output has dimensions nAnalogs like input time. It may be a mistake.

(3) Another problem is the documentation of @'return. Both CST_Analogs() and Analogs() don't explain well the expected outputs.

(4) Related issue: #98 (closed)

Please let me know if you need my help on this issue. There is no deadline but it's preferable to solve this issue and have a new release on CRAN soon, so we can have the ClimProjDiags release.

Cheers,
An-Chi

Ps., to use new Subset(), you can source it from gitlab. But since it is used internally in Analogs() and related functions, you need to source these functions (i.e., not use CSTools::Analogs) so they know to use the local Subset() version.

Assignee
Assign to
Time tracking