Learn R Programming

RCPA3 (version 1.3.1)

getC: Imports common dataset file types into R environment

Description

If you don't complete file argument, you will be prompted to select file. Supports dataset file format like Stata, SPSS, Rdata, and csv files. It previews imported data and asks you to confirm before returning a data frame. You must assign the returned data frame to an object to work with it. If getC doesn't support a file type, it may suggest other functions and packages for importing that type of file.

Usage

getC(file, confirm = TRUE, ...)

Value

Dataset specified in file argument as a data frame. You must assign this returned data frame to an object to work with it.

Arguments

file

(Optional) Path to file you want to get and load in your R session; if you do not specify file you will be prompted to select one.

confirm

(Optional) Do you want to confirm getting file before function results returned? (default: TRUE)

...

(Optional) Additional arguments passed to loading function

RCPA3 Package Tutorial Videos

Textbook References

  • Philip H. Pollock and Barry C. Edwards, An R Companion to Political Analysis, 3rd Edition (Thousand Oaks, CA: Sage Publications, Forthcoming 2022), Chapter 15.

  • Philip H. Pollock and Barry C. Edwards, The Essentials of Political Analysis, 6th Edition (Thousand Oaks, CA: Sage Publications, 2020), pp. 321-327. ISBN-13: 978-1506379616; ISBN-10: 150637961.

Online Resources

Examples

Run this code
   library(RCPA3)
   
   # basic call will prompt user to choose file
   if (FALSE) { 
   getC()
   }

Run the code above in your browser using DataLab