I am new here and am just beginning with R Studio. I have downloaded .nc data files from ST5 Satellite from the Copernicus hub and am attempting to make a plot with the variables - latitude, longitude, time and aerosol height. I have tried to use other examples to resolve but to no avail. Here is as far as I have gotten.
library(ncdf4)
library(raster)
ncpath <- ("~/Desktop/Summer 2020/Tropomi/Aerosol Height")
ncname <- "S5P_RPRO_L2__AER_LH_20180722T230340_20180723T004708_04009_01_010301_20190531T123254.nc"
nc <- nc_open(ncname)
lat <- ncvar_get(nc, varid = "PRODUCT/latitude")
lon <- ncvar_get(nc, varid = "PRODUCT/longitude")
time <- ncvar_get(nc, varid = "PRODUCT/time_utc")
so2 <- ncvar_get(nc, varid = "PRODUCT/aerosol_mid_height")
r <-brick(nc)
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘brick’ for signature ‘"ncdf4"’
Why am I getting this error message? Does anyone have any suggestions for what to try next? Thank you for reading.