Re: [R-pkg-devel] Help with making a package for Twitter Authentication

2015-11-23 Thread Peter Meissner
Hey,

I am not sure, that this is the right list for questions that are 'only 
mildly' related to package developement. Your question is more about 
API/webscraping etc. . 

Maybe someone can point to a better place to post questions like this?. 

... that beeing said ... 

If I understand your problem right, I would suggest to try out the 
twitteR package [1] which already has authentication and data retrieval 
build in. 

If you do want to do it on your own I would suggest building on top of 
httr [2] for  authentication and HTTP-communication to access 
information from the official Twitter API [3]. Make sure to have a look 
at the demo provided on httr's Github repo [4]. Also the httr vignette 
on how to write API wrapper packages might be useful and last and very 
least I build a kind of minimal package for reading tweets and tweeting 
ot be found on my Github [5] which might also be of use because it only 
implements reading tweets of specific user.

Good luck, Peter


[1] https://cran.r-project.org/web/packages/twitteR/index.html
[2] https://cran.r-project.org/web/packages/httr/index.html
[3] https://dev.twitter.com/rest/public
[4] https://github.com/hadley/httr/blob/master/demo/oauth1-twitter.r
[5] https://github.com/petermeissner/twitterlight



Am Do, 19. Nov, 2015 um 5:33 schrieb Tushar Sadhu 
:
> Hello and greetings
> 
> I have been doing Twitter Data Analysis following a few blogs which
> requires me to register as a developer and enter a PIN everytime I 
> want to
> start reading tweets. But now I have made a basic package which does 
> all
> the hectic authentication, but the PIN from an authorized app is still
> required.
> (specifically after twitCred is correctly defined and this step :
> twitCred$handshake(cainfo = system.file("CurlSSL", "cacert.pem", 
> package =
> "RCurl")) )
> Though it works and reduces the steps, it still has to go to the URL 
> and
> enter the PIN manually
> 
> So my questions are two :
> 
> 1. If I go ahead with the current method of reading tweets by logging 
> from
> my account, how do I automate the process of entering the PIN when 
> the code
> runs inside the package?
> 2. What is the standard method of gathering tweets without any
> authentication at all. How is it done professionally without using 
> anyone's
> account and PIN.
> 
> This is my first question here and I am not sure if I am following the
> right protocols or am asking silly questions. In either case I am 
> sorry.
> 
> Please help!
> Also Thankyou in advance :)
> 
> Regards
> Tushar Sadhu
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] saving user preferences per workspace

2015-12-13 Thread Peter Meissner
Hey,

as far as I understand it, it is not ok to do any writing to the filesystem
(except tempfiles) behind the back of the user - never ever (except on
installation).

But what you can do is implement explicit functions to explicitly save and
load options.

Furthermore, you can tell the user, that the load function will always look
for:

1. brailer_options_file.opt in the current working directory
2. for an brailer_options_file entry in the .Renviron file to determine if
there might be a file to load options from (e.g. brailer_options_file
entry=~/brailer_options_file.opt)
3. else the function does not laod any options

Depending on what is appropriate for your package you might than run the
options load function on package startup via putting an .onLoad function
into your R/zzz.R file.

I am not sure if that's the most elegant or efficient way to implement such
a thing but it served me well for the wikipediatrend package where I needed
a way for caching downloads and I am convinced that it is CRAN policies
compliant.

If there are better ideas or room for discussion I am eager to here it.


Best, Peter

2015-12-12 21:52 GMT+01:00 Godfrey, Jonathan :

> Hello,
>
> I wish to offer users of my BrailleR package the ability to save their
> preferences, which may change by the workspace.
>
> I've toyed with the ideas:
>
> 1.saving a file in the corresponding folder;  or,
>
> 2.   creating an object containing all the settings in the workspace
>
>
> In either scenario, the settings get picked up next time the user loads
> the package in the right workspace. Both have worked.
>
> My problem is that I think my functions to create or modify the file or
> object breach CRAN policies. I am certainly getting a NOTE for using
> assign(..., pos=1)
>
> I had thought to try using the parent environment instead of explicitly
> using 'pos=1' but sometimes my functions are operating at the grandchild
> level with respect to pos=1 and therefore fail.
>
> I think my previous solution of writing a file in the current folder was
> only getting past the CRAN checks because I was doing it with a condition
> of running R in interactive mode. if(interactive()){...}
> But I think it is a breach of the policies to write a file to the user's
> hard drive, and sneaking around with a solution that CRAN checks can't cope
> with (yet) really doesn't work for me.
>
> Any ideas, especially pointers to other packages that do manage this task
> would help me greatly.
>
> Thanks for any help/advice,
> Jonathan
>
>
>
> [[alternative HTML version deleted]]
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] new package? - Sports data from transfermarkt.com using rvest

2018-01-24 Thread Peter Meissner
Hey,

I am not a laywer but their terms are quite explicitly prohibiting
redistribution of their data without written consent.

Now you might build a package that does not collect, store and
redistributes the data but only allows to access the data provided there
'live' via some convenience functions. But I don't really know if that
argument actually is valid in any legal sense.

To be on the safe side, you probably should contact them.

Best, Peter


Am 24.01.2018 12:13 nachm. schrieb "Thierry Onkelinx" <
thierry.onkel...@inbo.be>:

> Dear Daniel,
>
> First of all you need to make sure that the licence of
> transfermarkt.com allows the usage that you have intended. If that is
> not clear from their website, then you should contact them rather than
> us.
>
> CRAN has several packages to assists in downloading data from online
> sources. But the source has to allow that kind of usage.
>
> Best regards,
>
> ir. Thierry Onkelinx
> Statisticus / Statistician
>
> Vlaamse Overheid / Government of Flanders
> INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE
> AND FOREST
> Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
> thierry.onkel...@inbo.be
> Havenlaan 88 bus 73, 1000 Brussel
> www.inbo.be
>
> 
> ///
> To call in the statistician after the experiment is done may be no
> more than asking him to perform a post-mortem examination: he may be
> able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher
> The plural of anecdote is not data. ~ Roger Brinner
> The combination of some data and an aching desire for an answer does
> not ensure that a reasonable answer can be extracted from a given body
> of data. ~ John Tukey
> 
> ///
>
>
>
>
> 2018-01-23 16:27 GMT+01:00 Kehl Dániel :
> > Dear List members,
> >
> > maybe this is not the right place to ask, if that is the case, please
> forward me to the right place.
> > I developed some functions to download and transform football/soccer
> related data from transfermarkt.com.
> > There are plans to create my first package based on these functions and
> of course develop them and add more later. As far as I know there is no API
> to that page, so I am using the rvest package.
> > My question is: is this an OK thing to do? Should I contact
> transfermarkt.com? My german is not perfect (just like my english), this
> is what I've found on thier webpage. Does that mean one can not create a
> package related to that page? Or can't crawl at all? Or just not allowed to
> sell the data? If it is allowed, can one post the package on CRAN at the
> end?
> >
> > Please if any of you have experience in that or just show me where to
> ask, do not hesitate!
> >
> > LEGAL NOTICE
> > © Transfermarkt GmbH & Co. KG 2000-2018
> >
> > All rights reserved.
> >
> > Der Inhalt dieser Website ist urheberrechtlich geschützt. Nachdruck,
> Aufnahme in Online-Dienste, Internet und Vervielfältigung auf Datenträger
> wie CD-ROM, DVD-ROM usw. dürfen, auch auszugsweise, nur nach vorheriger
> schriftlicher Zustimmung durch Transfermarkt erfolgen. Eine kommerzielle
> Weitervermarktung des Inhalts ist untersagt.
> >
> > Transfermarkt haftet nicht für unverlangt eingesandte Inhalte,
> Manuskripte und Fotos. Für Inhalte externer Links und fremde Inhalte
> übernimmt Transfermarkt keine Verantwortung.
> >
> > Thank you for all your insights and/or comments,
> >
> > best regards
> > Daniel
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Dr. KEHL Dániel
> >
> > adjunktus
> >
> >
> >
> >
> >
> > PÉCSI TUDOMÁNYEGYETEM KÖZGAZDASÁGTUDOMÁNYI KAR
> >
> > Közgazdaságtan és Ökonometria Intézet
> >
> > H-7622 Pécs, Rákóczi út 80. | www.ktk.pte.hu
> >
> > +36 72 501 599/ 23144 | ke...@ktk.pte.hu
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > __
> > R-package-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-package-devel
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Re: [R-pkg-devel] Submission to CRAN when package needs personal data (API key)

2018-09-05 Thread Peter Meissner
Hey,

Maybe webmockr (or something alike) can help:
https://cran.r-project.org/web/packages/webmockr/index.html

Best, Peter

Rainer M Krug  schrieb am Mi., 5. Sep. 2018, 15:38:

> OK - thanks. I will than disable the checks for CRAN.
>
> Thanks,
>
> Rainer
>
>
> > On 5 Sep 2018, at 15:37, Uwe Ligges 
> wrote:
> >
> > You should not run on CRAN. Note that the checks are done almost daily
> oin several platforms, hence the API key is used for about 10 check runs a
> day.
> >
> > Best,
> > Uwe Ligges
> >
> >
> >
> > On 05.09.2018 09:28, Rainer Krug wrote:
> >> Hi
> >> I have a package at GitHub (https://github.com/rkrug/ROriginStamp)
> which I am pre[paring for CRAN.
> >> It creates a trusted timestamp using the API fro OriginStamp (
> https://originstamp.org/home) which requires an API key. Now this API
> should not be made public, as to much traffic through one API key will lead
> to it’s blocking.
> >> I have stored the key encrypted in the travis.yml, and the package
> passes all tests.
> >> But if I send it to CRAN, it would fail the tests, as the api key is
> not in the package itself.
> >> I could disable all tests for CRAN which need the API key, but I think
> it would be better tu run the tests there as well (as an additional check
> to travis).
> >> My question:
> >> Is there a way of storing the API key encrypted, so that only the CRAN
> test servers can decrypt it, or is there another way can steal with this?
> >> Thanks,
> >> Rainer
> >> --
> >> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
> Biology, UCT), Dipl. Phys. (Germany)
> >> University of Zürich
> >> Cell:   +41 (0)78 630 66 57
> >> email:  rai...@krugs.de
> >> Skype:  RMkrug
> >> PGP: 0x0F52F982
> >> __
> >> R-package-devel@r-project.org mailing list
> >> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>
> --
> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
> Biology, UCT), Dipl. Phys. (Germany)
>
> University of Zürich
>
> Cell:   +41 (0)78 630 66 57
> email:  rai...@krugs.de
> Skype:  RMkrug
>
> PGP: 0x0F52F982
>
>
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] CRAN-Policies

2020-04-23 Thread Peter Meissner
Hello Everyone,

some weeks back I already wrote to CRAN but got no response. So, I post my
question here seeking for advice.

I am trying to publish a package to CRAN. I got rejected once with some
minor change requests. I implemented them and submitted again. This time I
got a whole array of change requests.

The problem is, I am confused since none of the requests is mentioned
anywhere in CRAN policies. So, are those mere suggestions? Are these common
policy now? Has everyone to implement them? How should I proceed?

(In general, I have no problem with complying with CRAN policies, but I am
not sure if these are actually common requirements now or not.)

Copy of the change requests:

* quote  **
Please add \value to all .Rd files for exported functions and explain
the functions results in the documentation.
f.i.: time_stamp.Rd
If a function does not return a value, please document that too, e.g.
\value{None}.

The \description tag in the .Rd files should be one or two sentences on
how the function works and what it's good for. Don't just repeat the
function name.
F.i.: stats_modus_multi.Rd

An .Rd file title should:
- be capitalized
- not end in a period
- be at most 65 characters long
- exist and stand alone (there must be exactly one title)
Please adjust to these standards and again don't simply repeat the name.
https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Documenting-functions
F.i.: stats_modus_multi.Rd

Please fix and resubmit, and document what was changed in the submission
comments.
*  quote **


Best, Peter

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] CRAN-Policies

2020-04-24 Thread Peter Meissner
Hey,

thanks for taking the time to reply - I will start working on my changes
requests then.

Best, Peter




Am Do., 23. Apr. 2020 um 20:51 Uhr schrieb Duncan Murdoch <
murdoch.dun...@gmail.com>:

> On 23/04/2020 2:34 p.m., Peter Meissner wrote:
> > Hello Everyone,
> >
> > some weeks back I already wrote to CRAN but got no response. So, I post
> my
> > question here seeking for advice.
> >
> > I am trying to publish a package to CRAN. I got rejected once with some
> > minor change requests. I implemented them and submitted again. This time
> I
> > got a whole array of change requests.
> >
> > The problem is, I am confused since none of the requests is mentioned
> > anywhere in CRAN policies. So, are those mere suggestions? Are these
> common
> > policy now? Has everyone to implement them? How should I proceed?
>
> I'd say that the changes being requested are all things stated in the
> Writing R Extensions manual, so this falls under the blanket statement
> in the policy that "CRAN hosts packages of publication quality and is
> not a development platform."
>
> > (In general, I have no problem with complying with CRAN policies, but I
> am
> > not sure if these are actually common requirements now or not.)
>
> I'd guess the requests will vary depending on who the reviewer is and
> what their mood is, but if you ignore their requests, you're not going
> to put them in a better mood.
>
> Duncan Murdoch
>
> >
> > Copy of the change requests:
> >
> > * quote >>>> **
> > Please add \value to all .Rd files for exported functions and explain
> > the functions results in the documentation.
> > f.i.: time_stamp.Rd
> > If a function does not return a value, please document that too, e.g.
> > \value{None}.
> >
> > The \description tag in the .Rd files should be one or two sentences on
> > how the function works and what it's good for. Don't just repeat the
> > function name.
> > F.i.: stats_modus_multi.Rd
> >
> > An .Rd file title should:
> > - be capitalized
> > - not end in a period
> > - be at most 65 characters long
> > - exist and stand alone (there must be exactly one title)
> > Please adjust to these standards and again don't simply repeat the name.
> >
> https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Documenting-functions
> > F.i.: stats_modus_multi.Rd
> >
> > Please fix and resubmit, and document what was changed in the submission
> > comments.
> > * <<<< quote **
> >
> >
> > Best, Peter
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-package-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-package-devel
> >
>
>

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] Publishing Java Wrappers The Right Way

2020-11-16 Thread Peter Meissner
Hey Everyone,

I have an R-package that wraps some Java code.
The dependencies needed are around 10MB.

Thus I split the package into 2 packages. One providing only the
dependencies:

https://github.com/petermeissner/kafkaesquejars

... and one providing the actual code:

https://github.com/petermeissner/kafkaesque


I submitted the first package to CRAN and it came back stating that:
"Package has FOSS license, installs .class/.jar but has no 'java' directory.
"

Of course there is no java directory because the package does not contain
any code, just dependencies
and those are placed in ./inst/java.

Now what to do? In response I added  ./java/sources.md file and listed all
dependencies as well as URLs where
the source code of those dependencies can be downloaded.

Is this correct? Do I miss something else?


I really would appreciate some guidance on doing this right.

Best, Peter

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] GitHub Actions - CI for pkg that depends on Java/rJava (Windows issue)

2021-01-22 Thread Peter Meissner
Hey,

Very interesting. I just made rJava work for Linux:

https://github.com/petermeissner/kafkaesque/blob/master/.github/workflows/tests.yml

Best, Peter




Blätte, Andreas  schrieb am Fr. 22. Jan. 2021
um 17:38:

> Dear colleagues,
>
> as recommended by rOpenSci (see
> https://ropensci.org/technotes/2020/11/19/moving-away-travis/) , I am
> moving to GitHub Actions for the CI for my R packages.
>
> My test case is the “bignlp” package I currently develop (
> https://github.com/https://github.com/PolMine/bignlpPolMine/bignlp). It
> is an interface to use the CoreNLP tools which are written in Java. (To
> explain: Unlike other existing packages that interface to CoreNLP, my
> intent is to make full use of Java multithreading.)
>
> Having used `usethis::use_github_action_check_full(),  CI works almost out
> of the box on the Ubuntu and macOS test environments. But I have a problem
> to ensure that rJava can find Java. The error I see (Windows, both
> architectures):
>
> Error: Error: R CMD check found ERRORs
> Execution halted
> .onLoad failed in loadNamespace() for 'rJava', details:
> call: inDL(x, as.logical(local), as.logical(now), ...)
> error: unable to load shared object
> 'D:/a/_temp/Library/rJava/libs/i386/rJava.dll':
> LoadLibrary failure: %1 is not a valid Win32 application.
>
> (For the full log, see: https://github.com/PolMine/bignlp/runs/1749892186)
>
> My first take was to add a step that would make sure that Java is present
> to .github/workflows/R-CMD-check.yaml:
>
>   - name: Install Java
> uses: actions/setup-java@v1
> with:
>   java-version: '8'
>   java-package: jdk
>
> But that only breaks things CI on Linux without having any change on
> Windows.
>
> I have consulted the manual ‘GitHub Actions with R’ (
> https://ropenscilabs.github.io/actions_sandbox/), but it does not address
> Java issues. I tried to find some R package on GitHub that would have rJava
> as a dependency and that uses GitHub Actions for CI – without success.
>
> This is why I’d like to query your experience: How I can make GitHub
> Actions work on Windows for the scenario of a package that depends on
> Java/rJava. Many thanks in advance!
>
> Kind regards
> Andreas (Blätte)
>
> --
> Prof. Dr. Andreas Blätte
> Professor of Public Policy and Regional Politics
> University of Duisburg-Essen
>
>
> [[alternative HTML version deleted]]
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel