[R] 텍스트 파일 읽기

R 2015. 8. 21. 15:04



R에서 텍스트 파일 읽는 예제이다. 


conn=file("json.txt",open="r")

line=readLines(conn)

for (i in 1:length(line)){

  print(line[i])

}

close(conn)



RStudio에서 디버그를 위해서 다음과 같이 파일을 쉽게 볼 수 있다.


file.show("json.txt")




system("open json.txt")



'R' 카테고리의 다른 글

[R]에서 불린(boolean) 값  (0) 2015.09.01
R 개발 후기  (0) 2015.08.25
[R] data frame을 excel, xml, json으로 export하기  (0) 2015.08.21
[R] string trim 함수  (0) 2015.08.21
R 컨퍼런스 2015 자료  (0) 2015.08.20
Posted by '김용환'
,