본문 바로가기
반응형

분류 전체보기123

(R) Make a new variable (ex,quantile) >library(MASS)>View(painters) WAY1 EXAMPLE 1) > painters$Drawing.ind=painters$Drawing>=mean(painters$Drawing)> View(painters) #You can see that there is a new variable Drawing.ind > head(painters) Composition Drawing Colour Expression SchoolDa Udine 10 8 16 3 ADa Vinci 15 16 4 14 ADel Piombo 8 13 16 7 ADel Sarto 12 16 9 8 AFr. Penni 0 15 8 0 AGuilio Romano 15 16 4 14 A Drawing.indDa Udine FALSED.. 2020. 11. 5.
(R) Extract rows and columns from data frame with conditions library(MASS)View(painters) When you try to adjust Rows ,that is trying to extract some rows that satisfies some conditions, you must handle left side of the comma in the bracket. Such as painters[(Conditions you want to see in rows) , ]. In contrast, you will see what happens when you want to handle the column of data frames. In summary, left side of the bracket is for rows and the right side i.. 2020. 11. 5.
Transformation Method -One Variable (Discrete, Continuous) As long as the relationship between the values of X and Y=g(x) is one to one, we can easily deal with the discrete case. For this case, probability remains unchanged. You should be careful here because the probability changes here. To assume that the probability given by Y=U(X) is differentiable and either increasing or decreasing for all values within the ra.. 2020. 10. 29.
(R)Wilkinson dot plot (+boxplot) > library(ggplot2) > str(mpg) tibble [234 x 11] (S3: tbl_df/tbl/data.frame) $ manufacturer: chr [1:234] "audi" "audi" "audi" "audi" ... $ model : chr [1:234] "a4" "a4" "a4" "a4" ... $ displ : num [1:234] 1.8 1.8 2 2 2.8 2.8 3.1 1.8 1.8 2 ... $ year : int [1:234] 1999 1999 2008 2008 1999 1999 2008 1999 1999 2008 ... $ cyl : int [1:234] 4 4 4 4 6 6 6 4 4 4 ... $ trans : chr [1:234] "auto(l5)" "man.. 2020. 10. 29.
반응형