R studio 한글 깨질떄


http://rfriend.tistory.com/10


기본 코드


http://pubdata.tistory.com/24

> abc <- 1:10

> efg <- 10:19

> ag <- cbind(abc,efg)


> mutate(ag, efg2 = efg + 100)
Error in UseMethod("mutate_") : 
  no applicable method for 'mutate_' applied to an object of class "c('matrix', 'integer', 'numeric')"



> ag <- data.frame(ag)

> mutate(ag, efg2 = efg + 100)

   abc efg efg2

1    1  10  110

2    2  11  111

3    3  12  112

4    4  13  113

5    5  14  114

6    6  15  115

7    7  16  116

8    8  17  117

9    9  18  118

10  10  19  119


mutate 함수는 data.frame으로 만든 데이터로 돌려야 돌아가는 것 같음. 




원 코드

#test====

abc <- 1:10

efg <- 10:19

ag <- cbind(abc,efg)


ag <- data.frame(ag)


mutate(ag, efg2 = efg + 100)







데이터 인덱싱


행과 열의 순서 바꾸기




> head(data_r)

  frame id   x   y dist_vec dist_meter spd_point  spd_mps spd_kph time

1     1  1 360 200     0.00     0.0000     0.000  0.00000  0.0000  0.1

2     2  2 137 117   236.93     1.5874     0.000  0.00000  0.0000  0.2

3     3  2 138 119     2.09     0.0140  2348.334 15.73384 56.6418  0.3

4     4  2 137 121     2.00     0.0134     0.962  0.00645  0.0232  0.4



> data_r <- data_r[c(10,1,2,3,4,5,6,7,8,9)]

> head(data_r)

  time frame id   x   y dist_vec dist_meter spd_point  spd_mps spd_kph

1  0.1     1  1 360 200     0.00     0.0000     0.000  0.00000  0.0000

2  0.2     2  2 137 117   236.93     1.5874     0.000  0.00000  0.0000

3  0.3     3  2 138 119     2.09     0.0140  2348.334 15.73384 56.6418



> getwd()


> list.files()



CSV file 
data <- read.csv('F:/B Image Processing Tracking/A data operation file/result1_NPH.csv', header = FALSE)


R 파일 경로 

다음과 같이 커서를 놓으면,

R 파일의 경로가 나옴





ctrl + 1 
ctrl + 2 console 


+ Recent posts