错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Importing Data

  • Jim Albert,
  • Maria Rizzo

摘要

Various methods are illustrated for importing data from local or internet text and .csv files, for situations when the data is unavailable in an R package. The base R functions read.table() and read.csv() as well as tidyverse package readr functions for importing data are illustrated by examples. Some data preprocessing tasks are described such as recoding data and identifying missing data. The chapter describes different methods for reshaping data from wide to long format using stack(), reshape(), melt() (reshape2 package) and pivot_longer() (tidyr package).