tidyData: Tidy the Data Read From File Downloaded From the Website

Description Usage Arguments Details Value

Description

After downloading the file from the website, the function tidy the data read from the file. Then organize the data to the form needed and ready to write to the MySQL database.

Usage

1

Arguments

file

character, the file name must follow the rule

Details

The input file name must follow the rule, that is "date + exchange + .xls". (Of course, now it can also handle with "shtml" file.) The file name contains two necessary element for the result, the "file date" and the exchange. These will be two columns.

There is another important column called "serial" which will be the primary key of database. It is organized as the following rule: "ZS" + file date + "ST" + effects date (month day) + exchange + code. Such rule will make sure that there is no duplicated record by eliminating the duplicated rows.

Value

The well-organized data.frame, ready to be written to MySQL database.


baixueyuan/zsl documentation built on May 11, 2019, 5:27 p.m.