error in running R
        4
    
    
    
        
        
        
        
            
                
                
                    
                        
                    
                
                    
                        Sorry,
How I can make my datasets numeric?
mim <- build.mim(mycounts,estimator="spearman")
Error in cor(dataset, method = estimator, use = "complete.obs") :
  'x' must be numeric
                    
                
                 
                
                
                    
                    
    
        
        
            R
        
        
    
        
        
            software-error
        
        
    
    
        • 5.1k views
    
                
                
                
                
    
    • 
link
    
    
    
    
    
    
        
    
        updated 3.2 years ago by
        
            Ram
        
        
    
        
    
    45k
        •
    
        written 10.0 years ago by
        
            zizigolu
        
        
    
        ★
    
    4.4k
    
 
            
            
         
     
 
     
    
        
            
                
    
    
    
    
        
        
        
        
            
                
                
                    
                        
                    
                
                    
                        I did like below
# read as matrix
as.matrix(mycounts)
# viewing mycounts class
class(mycounts)
# setting as numeric
sapply(mycounts, class)
                    
                
                 
                
                
                
                
                
    
    • 
link
    
    
    
    
    
    
        
    
        updated 6.4 years ago by
        
            Ram
        
        
    
        
    
    45k
        •
    
        written 9.8 years ago by
        
            zizigolu
        
        
    
        ★
    
    4.4k
    
 
            
            
         
     
 
         
        
            
                
    
    
    
    
        
        
        
        
            
                
                
                    
                        
                    
                
                    
                        head(mycounts)
output please. Try 
mim <- build.mim(as.numeric(mycounts),estimator="spearman")
                    
                
                 
                
                
                
                
                
    
    • 
link
    
    
    
    
    
    
        
    
        updated 6.4 years ago by
        
            Ram
        
        
    
        
    
    45k
        •
    
        written 10.0 years ago by
        
            apelin20
        
        
    
        ▴
    
    490
    
 
            
            
         
     
 
         
        
            
                
    
    
    
    
        
        
        
        
            
                
                
                    
                        
                    
                
                    
                        mim <- build.mim(data.matrix(mycounts),estimator="spearman")
                    
                
                 
                
                
                
                
                
             
            
            
         
     
 
         
        
            
                
    
    
    
    
        
        
        
        
            
                
                
                    
                        
                    
                
                    
                        Do you have row/column names in mycounts? If so, change these to headers and row.names.
Otherwise, try:
as.numeric(mycounts)
instead of just mycounts as suggested above.
                    
                
                 
                
                
                
                
                
    
    • 
link
    
    
    
    
    
    
        
    
        updated 6.4 years ago by
        
            Ram
        
        
    
        
    
    45k
        •
    
        written 10.0 years ago by
        
            ebrown1955
        
        
    
        ▴
    
    320
    
 
            
            
         
     
 
         
        
    
    
        
            
                Login before adding your answer.
         
    
    
         
        
            
        
     
    
    Traffic: 4407 users visited in the last hour
         
    
    
        
    
    
 
thank you,
I tried,
then
also
and
but all the same error
Can you provide the output of:
So we can see what R is seeing?
thank u
These values include alphanumeric characters. This function only accepts numbers. You can only input a dataset of numeric values.
these are rows name
exactly. so what's the result of