본문 바로가기
Data Analysis/Statistics

R기초

by mansoorrr 2023. 12. 3.

1. 많이 사용되는 패키지 및 코드

R code 기능 Python Code
install.packages("패키지명") 패키지 설치 pip install 패키지
library(패키지명) 패키지 로드 import 패키지
getwd() 현재 작업중 경로 산출 import os
os.getwd()
setwd(path) 작업폴더 새로지정 import os
os.chdir(path)
dir() 현재 작업중 폴더 파일목록 import os
os.path.listdir()
ls() 변수목록  
rm(list=ls()) 메모리 모든 객체 삭제  
; 명령어 끝 명시 -
print() 출력 print()
read.csv(filepath) csv읽기 import pandas as pd
pd.read_csv(filepath)
read.excel(filepath) excel읽기 pd.read_excel(filepath)

 

2. 변수생성

※ 변수명 규칙

 

3. 기초연산자

 

4. 데이터타입

가. 스칼라(Scalar)

나. 벡터(Vector)

다. 행렬(Matrix)

라. 데이터프레임(DataFrame)

마. 리스트(List)

'Data Analysis > Statistics' 카테고리의 다른 글

Python_Statistics_Regression  (0) 2024.03.01
Python_Statistics_Chi-square  (0) 2023.12.15
Python_Statistics_Anova(분산분석)  (0) 2023.12.11
Python_Statistics_t-test  (1) 2023.12.07
R-연관분석  (0) 2023.12.03