Created
June 1, 2015 13:22
-
-
Save SCgeeker/40b9b9602bae2ac3306a to your computer and use it in GitHub Desktop.
Recommended modification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 在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") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My solution for encoding problem