Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8344375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:21:07+00:00 2026-06-09T06:21:07+00:00

I used the following code: data<-read.csv(‘/Users/mf/Desktop/acceptor.csv’) just_nums<-sapply(data,is.numeric) just_nums_data<-data[,just_nums] str(just_nums_data) heatmap(just_nums_data) But got this output:

  • 0

I used the following code:

data<-read.csv('/Users/mf/Desktop/acceptor.csv')
just_nums<-sapply(data,is.numeric)
just_nums_data<-data[,just_nums]
str(just_nums_data)
heatmap(just_nums_data)

But got this output:

data<-read.csv('/Users/mf/Desktop/acceptor.csv')
just_nums<-sapply(data,is.numeric)
just_nums_data<-data[,just_nums]
str(just_nums_data)
'data.frame':   622 obs. of  16 variables:
 ID                                 : int  1 2 4 5 6 7 8 9 10 11 ...
 QnWeight_initial                   : int  158 165 137 129 155 150 119 153 137 153 ...
 QnWeight_initial_mg                : num  15.8 16.5 13.7 12.9 15.5 15 11.9 15.3 13.7 15.3   ....
 Days_till_1st_Wrkr                 : int  NA 21 NA 26 NA 23 22 20 22 NA ...
 Days_before_max_Wrkr_Eclosion      : int  NA 12 NA 7 NA 10 11 13 11 NA ...
 Wrkr_Eclosion_Bin                  : int  NA 3 NA 1 NA 1 2 3 2 NA ...
 QnMass_At_Wrkr_Eclosion            : int  NA 83 NA 73 NA 67 53 78 56 NA ...
 ColonyMass_At_Wrkr_Eclosion        : int  NA 117 NA 53 NA 91 85 111 96 NA ...
 Adult_Wrkrs_At_Wrkr_Eclosion       : int  NA 9 NA 5 NA 1 7 3 2 NA ...
 Mature_Brood_At_Wrkr_Eclosion      : int  NA 25 NA 13 NA 17 18 27 28 NA ...
 Sum_wrkrsPlusBrood_At_Wrkr_Eclosion: int  0 34 0 18 0 18 25 30 30 0 ...
QnMass_2wksLater                   : int  NA 124 NA NA NA 111 NA NA NA NA ...
QnMass_4wksLater                   : int  NA 117 NA NA NA 88 NA NA NA NA ...
ColonyMass_4wksLater               : int  NA 571 NA NA NA 736 NA NA NA NA ...
QnMass_2mnthsLater                 : int  NA 118 NA NA NA 86 NA NA NA NA ...
ColonyMass_2mnthsLater             : int  NA 445 NA NA NA 1817 NA NA NA NA ...
heatmap(just_nums_data)
Error in heatmap(just_nums_data) : 'x' must be a numeric matrix

I guess my confusion lays in the fact that the type “int” satisfies is.numeric() but doesn’t count as numeric when it is passed to heatmap(). Is this what is wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T06:21:09+00:00Added an answer on June 9, 2026 at 6:21 am
    • heatmap requires x to be a numeric matrix (see ?heatmap).
    • It tests this by using is.numeric(x)
      or more specifically a numeric object with 2 dimensions

      • length(di <- dim(x)) != 2 || !is.numeric(x))
    • a data.frame is not a numeric matrix, even if all the columns are numeric

    For example:

    .d <- data.frame(x= 1:10, y = runif(10))
    is.numeric(.d) 
    ## [1] FALSE
    

    So, you would need to run

    heatmap(as.matrix(just_nums_data))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used the following piece of code to read data from files as part
OLEDB can be used to read and write Excel sheets. Consider the following code
I have the following code which needs the data to be read from port
The following code (not really written by me) is used to write data of
I used following code, but it displays only 2 digit of ISO country name.
I have used following code to convert string to json and parse it. String
i have used following code to repeat a process creation/close iteratively dim vProcessInfo as
I have used following code to create a simple PDF file. It executes fine
I am trying to used following code but I am not getting good performance
I've used following code snippet for my activity in order to deal with orientation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.