Skip to content

Error when passing data in tibble format. #4

Description

@khataei

Environment:

  • OS: Ubuntu 20.04
  • Tester: Javad Khataei
  • Software version: R 4.1.2 from RStudio docker image

Description:

When the input data is passed in tibble format, it throws the following error.
Error: Must subset rows with a valid subscript vector. x Can't convert from <double> to <integer> due to loss of precision.

Steps to reproduce:

library(activityCounts)  
bad_input =  dplyr::as_tibble(activityCounts::sampleXYZ)  
activityCounts::counts(bad_input)

Expected Result:

A data frame with counts:


                  Time  x  y  z
1   2022-01-16 17:57:49  4 93 13
2   2022-01-16 17:57:50 21 50 14
3   2022-01-16 17:57:51 17 22 15
4   2022-01-16 17:57:52 22 39 23
5   2022-01-16 17:57:53 15 25 16
...

Actual Result:


Error: Must subset rows with a valid subscript vector.
x Can't convert from <double> to <integer> due to loss of precision.
Run `rlang::last_error()` to see where the error occurred.
In addition: Warning message:
In counts(data = dplyr::as_tibble(input), hertz = 100, x_axis = 2, 

acknowledgement:

This bug report is created based on Karl Brown feedback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions