Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to read from multiple csv files? #9

Open
NorthernHarrier opened this issue Nov 30, 2023 · 1 comment
Open

how to read from multiple csv files? #9

NorthernHarrier opened this issue Nov 30, 2023 · 1 comment

Comments

@NorthernHarrier
Copy link

Is there a way to read multiple csv files with one metadata json file?

@Robsteranium
Copy link
Owner

Yes the spec lets you specify a csvw:TableGroup which is effectively just:

{ "tables": [{"url": "1.csv"}, {"url": "2.csv"}] }

The CSVW tests provide an example:

> countries <- read_csvw("https://github.com/Robsteranium/csvwr/blob/master/tests/csvw-tests/countries.json")

> countries$tables[[1]]$dataframe
  countryCode latitude longitude                 name
1          AD 42.54624  1.601554              Andorra
2          AE 23.42408 53.847818 United Arab Emirates
3          AF 33.93911 67.709953          Afghanistan

> countries$tables[[2]]$dataframe
  countryRef year population
1         AF 1960    9616353
2         AF 1961    9799379
3         AF 1962    9989846

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants