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 9156085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:42:27+00:00 2026-06-17T12:42:27+00:00

I’m using a data set where the 11th column on a csv file has

  • 0

I’m using a data set where the 11th column on a csv file has numeric data. It contains some NA values too. Here is the str of the object:

str(dataheart)
 num [1:4706] 14.3 18.5 18.1 NA NA NA 17.7 18 15.9 NA ...

So, as a new student of R, I had expected the result of range(dataheart) to be the min and max values.From looking at the CSV file with data, I know that the min and max are 10.1 and 21.9.

But the above returns a vector

[1] NA NA

Is my understanding of this function incorrect?

  • 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-17T12:42:28+00:00Added an answer on June 17, 2026 at 12:42 pm

    You need

    range(x,na.rm=TRUE)
    

    see ?range

    For extra credit, here’s a list of the functions in the base and stats packages that use na.rm:

    uses_na_rm <- function(x) is.function(fx <- get(x)) && 
                             "na.rm" %in% names(formals(fx))
    basevals <- ls(pos="package:base")
    basevals[sapply(basevals,uses_na_rm)]
    ##  [1] "colMeans"                "colSums"                
    ##  [3] "is.unsorted"             "mean.default"           
    ##  [5] "pmax"                    "pmax.int"               
    ##  [7] "pmin"                    "pmin.int"               
    ##  [9] "range.default"           "rowMeans"               
    ## [11] "rowsum.data.frame"       "rowsum.default"         
    ## [13] "rowSums"                 "Summary.data.frame"     
    ## [15] "Summary.Date"            "Summary.difftime"       
    ## [17] "Summary.factor"          "Summary.numeric_version"
    ## [19] "Summary.ordered"         "Summary.POSIXct"        
    ## [21] "Summary.POSIXlt"        
    
    statvals <- ls(pos="package:stats")
    statvals[sapply(statvals,uses_na_rm)]
    ## [1] "density.default"  "fivenum"          "heatmap"          "IQR"             
    ## [5] "mad"              "median"           "median.default"   "medpolish"       
    ## [9] "quantile.default" "sd"               "var"   
    

    For further consideration of which functions in R deal with NAs and how, one could do an analogous search for functions with an na.action argument (lm and friends).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are using XSLT to translate a RIXML file to XML. Our RIXML contains
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I have just tried to save a simple *.rtf file with some websites and
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am using jsonparser to parse data and images obtained from json response. When
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am using JSon response to parse title,date content and thumbnail images and place
I want to count how many characters a certain string has in PHP, but

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.