Null
Null

Reputation: 11

R Error in ci_bod() "Data set not numeric at column: 1"

I am currently trying to use the ci_bod() from the package Compind in R to use the Benefit of the Doubt approach (BoD) for creating a composite indicator. I have a data frame (called "Data" in this example) with 7 subindicators (all numeric) which I would like to use to compile a composite indicator, which looks like this:

  Indic1        Indic2       Indic3       Indic4      Indic5       Indic6    Indic7
1 0.1310393914 -0.0688025494 0.0893357652 0.000000000 4.603536e-03 2.1277933 2.697052e-01
2 0.0573747901 -0.0800260705 0.3375335011 0.160919540 1.437293e-01 3.1103126 0.000000e+00
3 0.3430466905 -0.3456877394 0.1686795550 0.136363636 1.267847e-01 1.4737773 4.872327e-01

When I run the code I get the following error:

CI = ci_bod (Data)

Error in ci_bod(Data) : Data set not numeric at column: 1

I already ran the following codes to check:

is.numeric(Data$Indic1)
# [1] TRUE
typeof(Data$Indic1)
# [1] "double"
class(Data$Indic1)
# [1] "numeric"

I am thinking of also normalizing the indicators first before running the ci_bod, however I get the same error:

normalise_ci(Data,c(1:7),"POS", method=1, z.mean=0, z.std=1, ties.method ="average")

Error in normalise_ci(Data,c(1:7), "POS", method = 1, z.mean = 0, : Data set not numeric at column: 1

I am a bit confused as to why I am getting this error considering all the data is indeed numeric, and would really appreciate your help if you have any ideas in what could be causing this error.

Also to display the contents:

> str(Data)
tibble [3 × 7] (S3: tbl_df/tbl/data.frame)
 $ Indic1: num [1:3] 0.131 0.0574 0.343 
 $ Indic2: num [1:3] -0.0688 -0.08 -0.3457 
 $ Indic3: num [1:3] 0.08934 0.33753 0.16868 
 $ Indic4: num [1:3] 0 0.1609 0.1364 0.0976 
 $ Indic5: num [1:3] 0.0046 0.1437 0.1268 
 $ Indic6: num [1:3] 2.128 3.11 1.474 
 $ Indic7: num [1:3] 0.269705 0 0.487233

Upvotes: 1

Views: 78

Answers (0)

Related Questions