Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

argument must be coercible to non-negative integer in R

Tags:

r

anova

I am trying to run the following command on my dataset;

   pbad2way(formula = Balance~Occupation+Gender+Occupation:Gender, data = 
plxsell, est= "mom", nboot= 5000)

name of dataset is plxsell Balance, Occupation, Gender are the columns

but i am receiving following error;

Error in FUN(X[[i]], ...) : argument must be coercible to non-negative integer In addition: Warning message: In FUN(X[[i]], ...) : first element used of 'length.out' argument

Please help.

Thanks Akhil

like image 726
akhicoda Avatar asked Oct 26 '25 00:10

akhicoda


1 Answers

This error message appears when a function expects a number but receives something else.

For example the seq_len function expects a number:

seq_len(3) # no error, since function receives a number
seq_len(NA_character_) # Errors, since function expected a number and did not receive one
seq_len("a") # Errors, since function expected a number and did not receive one

You Should scrutinise your code and data for any instance where a function expects to receive a number but instead receives something else (like a character string or NA). NAs in your data could be a good place to start looking

like image 141
stevec Avatar answered Oct 27 '25 15:10

stevec