diff --git a/Derivative variable/dv.r b/Derivative variable/dv.r new file mode 100644 index 0000000..ed489c9 --- /dev/null +++ b/Derivative variable/dv.r @@ -0,0 +1,14 @@ +install.packages("hflights") +install.packages("dplyr") +library(hflights) +library(dplyr) + +str(hflights) + +colnames(hflights) +hflight_df = tbl_df(hflights) +hflight_df + +# gain이라는 컬럼명의 ArrDelay - DepDelay 값의 파생변수 생성 +aa = mutate(hflight_df, gain=ArrDelay-DepDelay) +aa \ No newline at end of file