Giter Club home page Giter Club logo

Comments (6)

praktiskt avatar praktiskt commented on May 26, 2024

Good input, however, coercing to POSIXct also unintentionally adds a time zone to the date, which means the date potentially no longer is the same. It also adds details (hour) that isn't originally there. One way is to coerce to UTC, but I'm not sure it's optimal.

Example (europe):

Sys.Date() %>% as.POSIXct()
## Returns: 2019-04-22 02:00:00 CEST

I think a warning could be a better approach?

from featuretoolsr.

grayskripko avatar grayskripko commented on May 26, 2024

if the user table contains a date column with 10000+ values the R session can be treated as frozen. So, the warning doesn't actually help but definitely is much better than a quiet problem

from featuretoolsr.

praktiskt avatar praktiskt commented on May 26, 2024

I've been thinking about this issue along with a few more of the open ones. I think you're bringing up a fair point, but I don't want to forcibly change user values. On the other hand, if it makes the R session unusable we should adress it forcibly..

What do think about adding support for this through a option-toggle (default on package load: on)?

Something along the lines of:

# Loads on package attach
options(
    featuretoolsR.force_posixct = T, #default
    featuretoolsR.posixct_tz = "UTC" #default
)

Runs something like this on entityset creation:

if(getOption("featuretoolsR.force_posixct")) {
  .cols = lapply(df, class)
  for (i in 1:length(.cols)) {
    colname <- names(.cols)[i]
    coltype <- .cols[[colname]]
    if (any(coltype == "Date")) {
      df[,colname] <- as.POSIXct(df[,colname], getOption("featuretoolsR.posixct_tz"))
    }
  }
}

from featuretoolsr.

praktiskt avatar praktiskt commented on May 26, 2024

I added something like this to the current development-branch (990b40e). Feel free to try it out.

from featuretoolsr.

grayskripko avatar grayskripko commented on May 26, 2024

Sorry, I don't feel I can help here

from featuretoolsr.

praktiskt avatar praktiskt commented on May 26, 2024

Resolved in #17

from featuretoolsr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.