R 스터디) 파일 읽어오기, read.table,csv

허승희·2025년 6월 25일
  • read.table() #txt파일 불러들일 때

    lungdata <- read.table(file.choose(), header=TRUE)
    #lungdata에 담을 건데 table을 읽을거야. 그리고 파일을 선택할거고, 컬럼도 출력해줘.

  • read.csv() #csv파일 불러들일 때

    lungdata2 <- read.csv(file.choose(), header=T)

  • str() #전체 구조를 보고싶을 때

    str(lungdata2)
    'data.frame' : 658 obs. of 5 variables:
    $ rate : num~
    ...

  • head(),tail()

    head(lungdata)
    #lungdata의 위의 6줄만 보여줘.
    tail(lungdata)

0개의 댓글