Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • airGR airGR
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 68
    • Issues 68
    • List
    • Boards
    • Service Desk
    • Milestones
  • Redmine
    • Redmine
  • Merge requests 7
    • Merge requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

La forge institutionnelle d'INRAE étant en production depuis le 10 juin 2025, nous vous recommandons d'y créer tous vos nouveaux projets.

  • HYCAR-HydroHYCAR-Hydro
  • airGRairGR
  • Issues
  • #195
Closed
Open
Issue created Jul 16, 2025 by Dorchies David@david.dorchiesDeveloper

SeriesAggreg fails on columns with units

Minimal Reproducible Example with calculation of mean temperature with units:

d <- seq.POSIXt(
  from = as.POSIXct("2020-01-01 00:00:00", tz = "UTC"),
  to = as.POSIXct("2021-12-31 23:59:59", tz = "UTC"),
  by = "1 day"
)
df <- data.frame(d = d, v = units::as_units(rep(1, length(d)), "°C"))
QM <- SeriesAggreg(df, Format = "%Y%m", ConvertFun = "mean")

The call to SeriesAggreg ends with: Error in [.data.frame(tsAggreg, , colnames(TabSeries0)) : undefined columns selected

The call to :

aggregate(. ~ Fac2, data = TabSeries2[, colTsAggreg], 
          FUN = listConvertFun[[y]], na.action = na.pass)

in SeriesAggreg.data.frame renames the columns containing the data... One workaround could be to rename manually the columns to their original name after this call.

This issue doesn't seem to occur on sum, and it seem that column renaming is a common issue with aggregate (https://stackoverflow.com/questions/15309205/name-columns-within-aggregate-in-r)

Edited Jul 16, 2025 by Dorchies David
Assignee
Assign to
Time tracking