davidcarslaw / openair

Tools for air quality data analysis
https://davidcarslaw.github.io/openair/
GNU General Public License v2.0
307 stars 113 forks source link

import function #372

Closed dos7408 closed 11 months ago

dos7408 commented 1 year ago

Bug description

After updating the openair package to ‘2.18.0’ two weeks ago I couldn't anylonger load data by the usual "import" command lines employed along several years. For instance typing:

mydata <- import("example data long.csv")

I get the message: Error in import ("example data long.csv") cannot find function "import"

Has anything changed in Openair regarding this function?

Thank you

Steps to reproduce

No response

Openair version

‘2.18.0’

jack-davison commented 12 months ago

import() was a bit of a legacy function and isn't currently supported by {openair}. This is because there are now loads of tools out there for reading csv and other files using R.

In base R you can use read.csv().

There are also whole packages dedicated to reading rectangular data - for example readr.

If you're having trouble, feel free to attach your CSV or other file and we can take a look.

Jack

(duplicate of https://github.com/davidcarslaw/openair/issues/366)

dos7408 commented 11 months ago

Thank you Jack, very clear. It might be useful make that explicit in Openair manuals.

Cheers,

Gian

jack-davison commented 11 months ago

No worries!

We've got it on the list to add a section on reading local data to the openair book, when time permits! https://github.com/davidcarslaw/openair-book/issues/10

Jack