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

Integration with R #9

Open
HamishUKRI opened this issue Aug 16, 2023 · 1 comment
Open

Integration with R #9

HamishUKRI opened this issue Aug 16, 2023 · 1 comment

Comments

@HamishUKRI
Copy link

HamishUKRI commented Aug 16, 2023

Additional context

Afternoon,

This is less of a feature request and more of a help request.

I have integrated the package with R through the package 'reticulate'.

I cannot however complete an API query , for example

mydf = comtradeapicall.previewTarifflineData(typeCode='C', freqCode='M', clCode='HS', period='202205',
reporterCode='36', cmdCode='91,90', flowCode='M', partnerCode=36,
partner2Code=None,
customsCode=None, motCode=None, maxRecords=500, format_output='JSON',
countOnly=None, includeDesc=True)

In the above example provided, how would you express None through R? Many of the None varibles are reported as string, however 'None' does not work and I receive the error Error in calling API: https://comtradeapi.un.... Same issue for True.

Setting a variable None = None, or None = "None" also does not return any results.

Any further help for using the package in R would be appreciated,

Many thanks.

@HamishUKRI
Copy link
Author

A further example...

mydf = ctdr$getFinalDataAvailability(subscription_key, typeCode='C', freqCode='A', clCode='HS',
period='2021', reporterCode='170') works fine..

mydf = ctdr$getFinalDataAvailability(subscription_key, typeCode='C', freqCode='A', clCode='HS',
period='2021', reporterCode=None) produced Error in eval(cl, parent.frame()) : object 'None' not found

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

1 participant