Home > Back-end >  Error in data[1:1000, ] : object of type 'closure' is not subsettable
Error in data[1:1000, ] : object of type 'closure' is not subsettable

Time:06-03

I'm beginner in R. I'm trying to subset a data and add it to another variable,Here is my code till now:

library(data.table)
library(parallel)
library(cluster)
library(clusterCrit)
library(TSrepr)
library(OpenML)
library(ggplot2)
library(grid)
library(animation)
library(gganimate)
library(av)
data <- OpenML::getOMLDataSet(data.id = 41060)
data <- data.matrix(data$data)
data_cons <- data[1:1000,]
period <- 48

, but I receive the following error:

Error in data[1:1000, ] : object of type 'closure' is not subsettable

I appreciate it if anyone guid me how to solve the problem.

CodePudding user response:

try to run install.packages('farff') first.

For me your code works, no error:

library(OpenML)

data <- OpenML::getOMLDataSet(data.id = 41060)
data <- data.matrix(data$data)
data_cons <- data[1:1000,]
  •  Tags:  
  • r
  • Related