plot( cars, main ="", xlab="", ylab="", type="n")
기본형식> plot(x,y, type="n")> grid()> points(x,y) > plot(cars, + main="cars: Speed vs. Stopping Distance (1920)", + xlab="Speed (MPH)", + ylab="Stopping Distance (ft)",+ type="n")# 기본 x, y 축 그래프를 셋팅한다. #cf. 줄바꿈은 Shift+Enter 를 눌러주면 된다. > grid()# 격자를 추가하여 그린다. > points(cars)# 실제로 점을 찍어 준다. > with(iris, plot(Petal.Length, Petal.Width, pch=as.integer(Species)))> legend(1.5, 2.4, c("setosa", "versicolor..
shinyUI(pageWithSidebar
shinyUI(pageWithSidebar( headerPanel("Click the button"), sidebarPanel( sliderInput("obs", "Number of observations:", min = 0, max = 1000, value = 500), actionButton("goButton", "Go!") ), mainPanel( plotOutput("distPlot") ))) http://www.r-tutor.com/r-introduction/data-frame require(graphics)pairs(mtcars, main = "mtcars data")coplot(mpg ~ disp | as.factor(cyl), data = mtcars, panel = panel.smooth..
R practice script 20140128
persp> # (3) Visualizing a simple DEM modelpersp>persp> z x y ## Don't draw the grid lines : border = NApersp> par(bg = "slategray")persp> persp(x, y, z, theta = 135, phi = 30, col = "green3", scale = FALSE,persp+ ltheta = -120, shade = 0.75, border = NA, box = FALSE)페이지 변경을 확인하기 위해 기다리는 중...persp> # (4) Surface colours corresponding to z-valuespersp>persp> par(bg = "white")persp> x y z nrz ncz ..
matrix in R
> matrix(c(1,2,3,4),2,4) [,1] [,2] [,3] [,4][1,] 1 3 1 3[2,] 2 4 2 4> matrix(c(1,2,3,4),2,12) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12][1,] 1 3 1 3 1 3 1 3 1 3 1 3[2,] 2 4 2 4 2 4 2 4 2 4 2 4> matrix(c(1:12),2,12) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12][1,] 1 3 5 7 9 11 1 3 5 7 9 11[2,] 2 4 6 8 10 12 2 4 6 8 10 12> matrix(c(1:242),2,12) [,1] [,2] [,3] ..