Ironholds / WikidataR

An R package for the Wikidata API
Other
53 stars 14 forks source link

get_item $-Operator-Error #24

Closed Krisselack closed 7 years ago

Krisselack commented 7 years ago

Hi, I wanted to use your wikidataR package. When using the get_item function get_item(id=1) I get the following error: Error in x$type : $ operator is invalid for atomic vectors.

It doesn't matter much, as i can refer the output to an object (->list) and use it, but it's still strange.

SessionInfo()

R version 3.3.1 (2016-06-21) Platform: i386-w64-mingw32/i386 (32-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1

locale: [1] LC_COLLATE=German_Austria.1252 LC_CTYPE=German_Austria.1252
[3] LC_MONETARY=German_Austria.1252 LC_NUMERIC=C
[5] LC_TIME=German_Austria.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

Ironholds commented 7 years ago

Thaaat's weird. It looks like a bug in the print method (so you can still go a <- wd_query("1"), and still str(a), but print doesn't work). I'll work on it; thanks!

bshor commented 7 years ago

I get the same error. The vignette isn't useful without this working! :)

Ironholds commented 7 years ago

If the basic fundamental code breaks then the vignette not being useful would seem to not be the highest priority. I will work on a patch to this later today.

bshor commented 7 years ago

Heh. Looking forward!

Ironholds commented 7 years ago

That's weird; it's now working for me with the dev release. What happens if you use the GitHub version?

RMHogervorst commented 7 years ago

The dev version indeed fixed the problem

Ironholds commented 7 years ago

Grand!

RMHogervorst commented 7 years ago

That's one to put in the tests I guess