[R] [R-pkgs] Package BatchGetSymbols

2016-11-06 Thread Marcelo Perlin
Dear R users,

If you use quantmod::GetSymbols to download financial data from yahoo or
google finance, you might find my new package  *BatchGetSymbols* very
useful. It no only downloads data for multiple tickers but also organizes
it in an efficient way, making it easy to use dplyr and ggplot2 in the
resulting dataframe.

You can check the vignette here:
https://cran.r-project.org/web/packages/BatchGetSymbols/vignettes/BatchGetSymbols-vignette.html

And the package here:
https://cran.r-project.org/web/packages/BatchGetSymbols/index.html

As usual, comments and suggestions are very welcome.

Best,

-- 
Marcelo Perlin
Professor Adjunto | Escola de Administração
Universidade Federal do Rio Grande do Sul
Rua Washington Luiz, 855 | 90010-460| Porto Alegre RS| Brasil
Tel.: (51) 3308-3303 | www.ea.ufrgs.br
http://lattes.cnpq.br/3262699324398819
https://sites.google.com/site/marceloperlin/

[[alternative HTML version deleted]]

___
R-packages mailing list
r-packa...@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-packages
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] About identification of CRAN CHECK machines in logs

2016-06-10 Thread Marcelo Perlin
I don't know Hadley. But you can see evidence of "something" systematically
installing the packages in the log data. From my two CRAN packages I
noticed a high correlation in the number of downloads.

Try the following script, which will pick 5 random packages from CRAN and
calculate the correlation matrix between their differenced number of
downloads. To avoid spurious correlations,  I removed the weekends since we
can expect some seasonality and also the zero entries. Its crude, I know,
but it does shows some positive associations between the number of
installations of the packages.

If not CRAN, who/what is downloading this packages and how can I set it
apart from the actual user installations?

Many thanks!


# get packages
df <- as.data.frame(available.packages())

# choose 5 random
idx <- sample(seq(nrow(df)))[1:5]
df<- df[idx,]

my.pkgs <- as.character(df$Package)

#my.pkgs <- c('RndTexExams','GetTDData')

dl.df <- cranlogs::cran_downloads(my.pkgs, from = '2015-01-01', to =
Sys.Date())

# remove zeros entries
dl.df$count[dl.df$count==0] <- NA

# remove weekends
dl.df$sat.sun <- as.POSIXlt(dl.df$date)$wday
dl.df <- dplyr::filter(dl.df, sat.sun != 0, sat.sun != 6)

# to wide (for corr)
dl.df <- tidyr::spread(dl.df, key = package,value = count)

# remove na
dl.df <- dl.df[complete.cases(dl.df), ]

diff.mat <- diff(as.matrix(dl.df[,3:ncol(dl.df)]))
cor(diff.mat)

___

On Thu, Jun 9, 2016 at 6:18 PM, Hadley Wickham  wrote:

> On Thu, Jun 9, 2016 at 9:24 AM, Marcelo Perlin 
> wrote:
> > Hi,
> >
> > I recently released two packages (RndTexExams and GetTDData) in CRAN and
> > I'm trying to track the number of downloads and location of users.
> >
> > I wrote a simple script to download and analyze the log files in
> http://cran
> > -logs.rstudio.com.
> > I realized, however, that during the release of a new version of the
> > packages there is a spike in the number of downloads. I believe that the
> > CRAN checks are included in the number of installations of the package in
> > the log files.
>
> I don't think that's true. Why would CRAN be installing the package
> from a mirror?
>
> Hadley
>
> --
> http://hadley.nz
>



-- 
Marcelo Perlin
Professor Adjunto | Escola de Administração
Universidade Federal do Rio Grande do Sul
Rua Washington Luiz, 855 | 90010-460| Porto Alegre RS| Brasil
Tel.: (51) 3308-3303 | www.ea.ufrgs.br
http://lattes.cnpq.br/3262699324398819
https://sites.google.com/site/marceloperlin/

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] About identification of CRAN CHECK machines in logs

2016-06-09 Thread Marcelo Perlin
Hi,

I recently released two packages (RndTexExams and GetTDData) in CRAN and
I'm trying to track the number of downloads and location of users.

I wrote a simple script to download and analyze the log files in http://cran
-logs.rstudio.com.
I realized, however, that during the release of a new version of the
packages there is a spike in the number of downloads. I believe that the
CRAN checks are included in the number of installations of the package in
the log files.

I see from the log files the existence of column "ip_id", which sets a
daily unique id for each new ip. My question is, can CRAN set the ip_id of
the CRAN machines to a fixed value so that we can filter only "real" users
out of the data? Can anyone see any other way around it?


Thanks.

-- 
Marcelo Perlin
Professor Adjunto | Escola de Administração
Universidade Federal do Rio Grande do Sul
Rua Washington Luiz, 855 | 90010-460| Porto Alegre RS| Brasil
Tel.: (51) 3308-3303 | www.ea.ufrgs.br
http://lattes.cnpq.br/3262699324398819
https://sites.google.com/site/marceloperlin/

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Can I use PhantomJS or assume a firefox instalattion for usage with RSelenium in CRAN Machines?

2016-05-23 Thread Marcelo Perlin
Thanks David,

I figured out a way to get the data I want without RSelenium.

Apreciate the help, though.

Best,



On Thu, May 19, 2016 at 8:51 PM, David Winsemius 
wrote:

>
> > On May 19, 2016, at 7:49 AM, Marcelo Perlin 
> wrote:
> >
> > Hi Guys,
> >
> > First time posting here.
> >
> > I have a CRAN package called GetTDData that downloads and reads public
> data
> > from a government website (
> > http://www.tesouro.fazenda.gov.br/tesouro-direto-balanco-e-estatisticas
> ).
> >
> > Recently (today), the website has changed its structure by removing
> > permanent links of the files and creating a "random" html address for the
> > files that really matter. This means that when I download the souce html
> > code, I don't have the information for the actual links, but just a bunch
> > of code.
> >
> > In the past I have dealed with this type of problem by forcing the
> > renderization of the page using RSelenium with firefox or PhantomJS and
> > then capturing the desired href locations.
> >
> > My question is, if integrate my code with RSelenium using firefox or
> > PhantonJS, will it pass on all arquitectures (win, linux, solaris) of
> CRAN?
>
> I dn't have a lot of experience at this but I can say that at least one
> person whose experience I trust recentlyreported in Rhelp that RSelenium
> tends to be a fragile interface. Nonetheless, he does use it on occasion
> and it clearly "works" on more than one platform. If your code is not
> confidential and the website has at least a guest login capacity, you could
> post it here and ask for trial runs on whatever platform(s) you may not
> have testing capacities for.
>
> >
> > --
> > Marcelo Perlin
> > Professor Adjunto | Escola de Administração
>
> --
>
> David Winsemius
> Alameda, CA, USA
>
>


-- 
Marcelo Perlin
Professor Adjunto | Escola de Administração
Universidade Federal do Rio Grande do Sul
Rua Washington Luiz, 855 | 90010-460| Porto Alegre RS| Brasil
Tel.: (51) 3308-3303 | www.ea.ufrgs.br
http://lattes.cnpq.br/3262699324398819
https://sites.google.com/site/marceloperlin/

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] Can I use PhantomJS or assume a firefox instalattion for usage with RSelenium in CRAN Machines?

2016-05-19 Thread Marcelo Perlin
Hi Guys,

First time posting here.

I have a CRAN package called GetTDData that downloads and reads public data
from a government website (
http://www.tesouro.fazenda.gov.br/tesouro-direto-balanco-e-estatisticas).

Recently (today), the website has changed its structure by removing
permanent links of the files and creating a "random" html address for the
files that really matter. This means that when I download the souce html
code, I don't have the information for the actual links, but just a bunch
of code.

In the past I have dealed with this type of problem by forcing the
renderization of the page using RSelenium with firefox or PhantomJS and
then capturing the desired href locations.

My question is, if integrate my code with RSelenium using firefox or
PhantonJS, will it pass on all arquitectures (win, linux, solaris) of CRAN?

I'm happy to hear any other ideas.

Many thanks!

-- 
Marcelo Perlin
Professor Adjunto | Escola de Administração
Universidade Federal do Rio Grande do Sul
Rua Washington Luiz, 855 | 90010-460| Porto Alegre RS| Brasil
Tel.: (51) 3308-3303 | www.ea.ufrgs.br
http://lattes.cnpq.br/3262699324398819
https://sites.google.com/site/marceloperlin/

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Regarding posting a package to R-forge (with one of the dependent packages not in CRAN)

2008-12-02 Thread Marcelo Perlin
Hi Uwe,

Thanks for the reply.

I already tried that a couple of weeks ago, with the exactly the same
arguments you posted. So far no reply from the author.
I going to try again.

Regards,
Marcelo.

On Tue, Dec 2, 2008 at 9:42 AM, Uwe Ligges
<[EMAIL PROTECTED]>wrote:

>
>
> Marcelo Perlin wrote:
>
>> Hi Guys,
>>
>> Recently I wrote a package for dealing with Markov Switching Regressions
>> in
>> R and it is included in the Rmetrics project.
>>
>> https://r-forge.r-project.org/projects/rmetrics/
>>
>> Everything works fine when I use it in computer.
>>
>> But, the package depends on the use of optimization functions from the
>> package Rdonlp2, which is not available on CRAN.
>> So, if I have Rdonlp2 in my laptop (or any computer) I can load the
>> package
>> and it works fine.
>>
>> But, the problem Im having is that when I submit the package to R-Forge,
>> the
>> R-Forge system try to build it (Rcm -build ... ) and outputs a error
>> message
>> saying that Rdonlp2 is not found. This means that its not possible to get,
>> from the internet, the package I wrote with install.package(...).
>>
>> Did anyone had a simillar problem ? Any suggestions for a workaround or
>> solution ?
>>
>
>
> Well, if others should be able to use your package, they will probably also
> need "Rdonlp2". How are those others supposed to get it? I fear you will
> need to make it available as well - and if you are not the authors, convince
> its author to make it available.
>
> Best,
> Uwe Ligges
>
>
>
>  Thanks for your help!
>>
>> Regards,
>> Marcelo.
>>
>>[[alternative HTML version deleted]]
>>
>> __
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Regarding posting a package to R-forge (with one of the dependent packages not in CRAN)

2008-11-28 Thread Marcelo Perlin
Hi Guys,

Recently I wrote a package for dealing with Markov Switching Regressions in
R and it is included in the Rmetrics project.

https://r-forge.r-project.org/projects/rmetrics/

Everything works fine when I use it in computer.

But, the package depends on the use of optimization functions from the
package Rdonlp2, which is not available on CRAN.
So, if I have Rdonlp2 in my laptop (or any computer) I can load the package
and it works fine.

But, the problem Im having is that when I submit the package to R-Forge, the
R-Forge system try to build it (Rcm -build ... ) and outputs a error message
saying that Rdonlp2 is not found. This means that its not possible to get,
from the internet, the package I wrote with install.package(...).

Did anyone had a simillar problem ? Any suggestions for a workaround or
solution ?

Thanks for your help!

Regards,
Marcelo.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.