0

I like to import a data frame as a "task". Some of the columns are dates (of data type "yearmon") and I like to import them with the role "name" or "order".

Unfortunately, it seems I have to first import the whole matrix and can only change roles after importing. But this import is not possible, as the format "yearmon" does not qualify as a "feature".

How can I get around this?

ds_col
  • 129
  • 10
  • 2
    Regardomg the yearmon column. You should be able to convert it to numeric and use it as such. Eg. June 2020 is just `2020.5` – jakob-r Mar 19 '21 at 16:46

1 Answers1

2

You can only set the column roles after you have created a Task object.

The .$col_roles() is a method which can only be called after constructing the object in the first place.

Also note that you do not "import a data.frame as a task" but you create an object of class Task by providing a data.frame as an argument. You should be able to supply any valid data.frame when creating a Task.

pat-s
  • 5,992
  • 1
  • 32
  • 60