From the csv file, I loaded the date into the R framework, which looks like this:
> head(mydata)
row lengthArray sports num_runs percent_runs
1 0 4 [24, 18, 24, 18] 0 0
2 1 10 [2, 2, 2, 2, 2, 2, 2, 2, 2, 2] 0 0
3 2 4 [0, 0, 0, 0] 0 0
4 3 2 [0, 0] 0 0
5 4 2 [18, 18] 0 0
6 5 1 [0] 0 0
I can access and get types for whole data frames without problems, but I cannot figure out how to access sports:
> class(mydata[4,3])
[1] "factor"
> string_factor = mydata[1,3]
> string_factor
[1] [24, 18, 24, 18]
6378 Levels: [0] [0, 0] [0, 0, 0] [0, 0, 0, 0] ... [9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9]
> class(string_factor)
[1] "factor"
> string_factor_numeric = as.numeric(string_factor)
> string_factor_numeric
[1] 5181
I think R's best answer would be βnot to do this,β but the data is doing this, so I wonder how I can get these numbers from an array so that I can use them.
I should also note that this convert data.frame columns from factors to characters did not give any error message, but had no effect as the array column continued to be classified as factors.
UPDATE: from the comments, you can see this can get you somewhere:
mydata[,3] <- as.character(mydata[,3])
However, this still will not lead you to an array with individually accessible elements.