open_gdt: opening _gretl_ and _gretl_-supported data files

Description Usage Arguments Value Author(s) Examples

Description

The function can open data files of the following formats: ‘*.gdt, *.gdtb’ (gretl data files), ‘*.csv’, ‘*.txt’, ‘*.gnumeric’ (Gnumeric), ‘*.ods’ (Open Document), ‘*.xls, *.xlsx’ (Excel), ‘*.dta’ (Stata), ‘*.wf1’ (Eviews), ‘*.sav’ (SPSS), ‘*.xpt’ (SAS xport), ‘*.dat’ (JMulTi).

Usage

1
2
open_gdt(fpath, mkstruct = TRUE, info = TRUE)
# open_gdt("denmark.gdt")

Arguments

fpath

quoted name of a data file; the rules of adding the full path are the same as in gretl; can open data files of all gretl-supported formats: Stata, E-views, SPSS, SAS, etc. Path to a file is not needed for gretl sample files and for files in gretl working directory

mkstruct

logical; whether to preserve time series structure; currently only yearly, quarteerly, monthly, weekly and dayly data are supported: in these cases the output data frame columns will be ts objects with 'right' time-series attributes; otherwise the output data.frame contains character-valued column named "obs" which can be translated into time structure by a user.

info

logical; whether to import data description (if any); if info = TRUE (the default) the output data frame will have additional "description" attribute : a character vector containing data set information. It can be printed in intelligible form by description function.

Value

data.frame if info = TRUE it will have "description" attribute.

Author(s)

Oleh Komashko

Examples

1
2
3
4
5
6
7
8
denmark = open_gdt("denmark.gdt")
head(denmark)
description(denmark)

## Not run: 
gold = open_gdt("http://www.principlesofeconometrics.com/poe4/data/stata/gold.dta")
description(gold)
## End(Not run)

Rgretl documentation built on May 2, 2019, 3:46 p.m.