(This article is adapted to the latest version of rvest package.)
In my previous post, I demonstrated how we can scrape online data using existing packages.继续阅读 »
rlist 0.3 is released! This package now provides a wide range of functions for dealing with list objects. It can be especially useful when they are used to store non-tabular data.继续阅读 »
pipeR 0.4 is released! Check it out at the project page. In this new version, two things happen. First, %>>% handles everything. Second, the introduction of Pipe object.继续阅读 »
In pipeR 0.4 version, one of the new features is Pipe() function. The function basically creates a Pipe object that allows command chaining with $, and thus makes it easier to perform operations in pipeline without any external operator.继续阅读 »
The motivation of pipeline operator is to make code more readable. In many cases, it indeed better organizes code so that the logic is presented in human-readable fluent style. In other cases, however, such operators can make things worse.继续阅读 »
As we know, a Brownian motion is usually formulated as $$dx_t = \mu\,dt+\sigma\,dW_t$$ which is the continuous case of a random walk. In some cases, it is quite convenient to use this formulation to describe the characteristic of asset prices due to its highly unpredictable behavior.继续阅读 »
Problem Description:
Given a sequence of integers a1, …, an and q queries x1, …, xq on it. For each query xi you have to count the number of pairs (l, r) such that 1 ≤ l ≤ r ≤ n and gcd(al, al + 1, …, ar) = xi. is a greatest common divisor of v1, v2, …, vn, that is equal to a largest positive integer that divides all 继续阅读 »