User Tools

Site Tools


blog

Quantify the impact of your R packages

Software development often takes a lot of time but its impact is often difficult to evaluate. If you have developed an R package and upload it to CRAN, you might be able to get some download information but not a lot.

Since R studio hosts the CRAN mirror, it keeps tracking the download statistics of the R packages installed from the RStudio mirror and therefore provides some useful information. It also provides an R package -cranlogs- to get the information within R. Certainly, the information is not incomplete but at least it provides the developers some ideas on how their packages are used.

For example, the code below is used to get the download information in the past month of an R package coefficientalpha I developed.

library(cranlogs)

cran_downloads('coefficientalpha', when='last-month')

         date count          package
1  2019-04-08    15 coefficientalpha
2  2019-04-09    15 coefficientalpha
3  2019-04-10    25 coefficientalpha
4  2019-04-11    18 coefficientalpha
5  2019-04-12    25 coefficientalpha
6  2019-04-13    13 coefficientalpha
7  2019-04-14    11 coefficientalpha
8  2019-04-15    22 coefficientalpha
9  2019-04-16    15 coefficientalpha
10 2019-04-17    31 coefficientalpha
11 2019-04-18    11 coefficientalpha
12 2019-04-19    19 coefficientalpha
13 2019-04-20    14 coefficientalpha
14 2019-04-21    14 coefficientalpha
15 2019-04-22    19 coefficientalpha
16 2019-04-23     6 coefficientalpha
17 2019-04-24    21 coefficientalpha
18 2019-04-25    19 coefficientalpha
19 2019-04-26     7 coefficientalpha
20 2019-04-27    11 coefficientalpha
21 2019-04-28    13 coefficientalpha
22 2019-04-29    38 coefficientalpha
23 2019-04-30    14 coefficientalpha
24 2019-05-01    18 coefficientalpha
25 2019-05-02    18 coefficientalpha
26 2019-05-03    10 coefficientalpha
27 2019-05-04     3 coefficientalpha
28 2019-05-05    15 coefficientalpha
29 2019-05-06    58 coefficientalpha
30 2019-05-07    39 coefficientalpha
2019/05/08 15:55 · johnny · 0 Comments · 0 Linkbacks

Apache log process using GoAccess

sudo zcat /var/log/apache2/access-advstats.*.gz | sudo goaccess /var/log/apache2/access-advstats.log -o report.html --log-format=COMBINED
2019/03/04 09:41 · johnny · 0 Comments · 0 Linkbacks

regex

Replace $abc$ with $`abc`$:

\$([^$]*)\$

\$`\1`\$

Replace 4. 5 with 4.5

(\d)[.]\s+(\d)

$1.$2


([a-zA-Z])[.]([a-zA-Z])
$1. $2
2018/11/03 23:48 · johnny · 0 Comments · 0 Linkbacks

Let's encrypt SSL

Install SSL for Godaddy web hosting through cpanel.

  1. Install certbot on your local machine:
    wget https://dl.eff.org/certbot-auto
    chmod a+x certbot-auto
  2. Generate SSL Certificate
    ./certbot-auto certonly --manual
  3. Install on Godaddy
    1. Open fullchain.pem and copy the top half of the file (only the first certificate).
    2. Log in to your GoDaddy cPanel. In the Security section, click SSL/TLS. Under Certificates (CRT), click “Generate, view, upload, or delete SSL certificates.”
    3. Paste the first half of the certificate under “Upload a New Certificate”, where it says, “Paste the certificate into the following text box:” Type a description and click “Save Certificate.”
    4. Under “Install and Manage SSL for your site (HTTPS),” click “Manage SSL sites.”
    5. Under “Install an SSL Website,” select your first domain. Click “Autofill by Domain” and the certificate should populate in the first box. (All 3 boxes may be automatically populated.)
    6. Open privkey.pem and copy the content to the private key field
    7. If the “Certificate Authority Bundle” is not filled in, copy the second half of the fullchain.pem file to the field.
  1. Click “Install Certificate.”
2018/02/22 09:59 · johnny · 0 Comments · 0 Linkbacks

Control R figure output format

To control the site wide option, use

nano Rhome/etc/Rprofile.site

The home path (Rhome) can be found using

R.home(component = "home")

On Ubuntu, it is often /usr/lib/R.

In the Rprofile.site, input

options(device='svg')

will change the default output to svg instead of pdf.

2016/11/07 14:25 · johnny · 0 Comments · 0 Linkbacks

Older entries >>

Blog History


Note. Everything on this blog only reflects my personal view which may or may not be true and is not related to any organization or institute.


Page Tools