pxR icon indicating copy to clipboard operation
pxR copied to clipboard

Read multilingual files

Open RPanczak opened this issue 4 years ago • 3 comments

Hi @cjgb

Many thanks for super useful package!

Is there a way to define which language of the file to use?

I'm working with file from BfS that comes in German but has support for three other languages. Is there a way to specify which one to use during the read?

image

PS This might be related to #8

RPanczak avatar Aug 24 '21 11:08 RPanczak

This doesn't seem to be possible at the moment. However, there is a fork of this project where this has been implemented. See here: https://github.com/uthink-git/pxR/commit/6636c1d3449ed83be3be76f328d51f99341f3cc3

Perhaps this change could be incorporated?

ofurkusi avatar Dec 03 '21 15:12 ofurkusi

@RPanczak to get BFS data in multiple languages you can also use the {BFS} R package.

As the dataset is very large, you need to query specific elements of the data (below by spatial level and gender for example) due to limitation of the PXWeb API. The full documentation is here: https://felixluginbuhl.com/BFS/

library(BFS) #install.packages("BFS")

BFS::bfs_get_data(
  number_bfs = "px-x-0102020206_102",
  language = "en",
  query = list(
    "Jahr" = "2010", 
    "Kanton (-) / Bezirk (>>) / Gemeinde (......)" = "*", 
    "Geschlecht" = "*"
    )
)

lgnbhl avatar Aug 04 '23 09:08 lgnbhl