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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:58:47+00:00 2026-06-17T23:58:47+00:00

I am writing a function in R to extract some air quality modelling data

  • 0

I am writing a function in R to extract some air quality modelling data from netCDF files. I have the Package “ncdf” installed.

In order to allow other users or myself to choose what variables to extract from a netCDF file, I would like to extract the names of all variables in the file, so that I can present in a simple list rather than just print.ncdf() the file to give too much information. Is there any way of doing it?

I tried unlist() to the var field of the ncdf object but it seemed that it returned the contents as well…

I googled and searched stack*overflow* but didn’t seem to find an answer, so your help is very much appreciated.

Many thanks in advance.

  • 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-17T23:58:48+00:00Added an answer on June 17, 2026 at 11:58 pm

    If your ncdf object is called nc, then quite simply:

    names(nc$var)
    

    With an example, using the dataset downloaded here, for instance (since you didn’t provide with one):

    nc <- open.ncdf("20130128-ABOM-L4HRfnd-AUS-v01-fv01_0-RAMSSA_09km.nc")
    names(nc$var)
    [1] "analysed_sst"     "analysis_error"   "sea_ice_fraction" "mask"   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing some quick code to try and extract data from an mp3 file
I am having some problem with writing a function to extract strings from a
I'm writing a Powershell script that will extract a set of data files from
I am writing a reporting gem that will have some helpers to extract data
I am writing a function to extract decimals from a number. Ignore the exception
I am writing a function short getBits(short data, int p, int n) I have
I'm writing a user-defined function to extract values from an XML column in SQL
I am writing a function which would get all files from a particular directory
I'm writing a script to extract some useful data about a series of chemical
I have a function for writing ppm files (a picture format) to disk. It

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.