Skip to content

Instantly share code, notes, and snippets.

@SCgeeker
Created June 1, 2015 13:22
Show Gist options
  • Save SCgeeker/40b9b9602bae2ac3306a to your computer and use it in GitHub Desktop.
Save SCgeeker/40b9b9602bae2ac3306a to your computer and use it in GitHub Desktop.
Recommended modification
## 在Rstudio,Tools -> Global Options -> General -> Default Text Encoding -> UTF-8
## 系統語系要設定為台灣正體中文
Sys.setlocale(category = "LC_ALL", locale = "cht")
##讀取檔案、提取資料與製造變項
#這是一般 TXT 檔,檔頭有變項名稱
#資料來自於 NHIS 2010 調查,取 1955 年以前出生者(55歲以上)
#視力困難、聽力困難、移動困難與溝通困難變項,分數越高越有困難
## 預設資料編碼為CP950(BIG5)
dta <- read.table(file = 'data/Quality_of_Life.txt', header = TRUE, encoding = "CP950")
@SCgeeker
Copy link
Author

SCgeeker commented Jun 1, 2015

My solution for encoding problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment