다음과 같은 문제가 있습니다. title
란 열이있는 표가 있습니다.분할 열이 R
title
열은 To kill a mockingbird (1960)
과 같은 값을 갖는 행을 포함합니다.
기본적으로 열의 형식은 [title] ([year])
입니다. 두 개의 열이 필요합니다 : title
및 year
, year
대괄호가 없습니다.
다른 문제 중 하나는 괄호가 포함 된 제목이있는 행이 있다는 것입니다. 그러나 기본적으로 모든 행의 마지막 6자는 연도를 괄호로 묶습니다.
두 개의 열, title
및 year
은 어떻게 만듭니 까?
는 내가 가지고있는 것은 :
Books$title <- c("To kill a mockingbird (1960)", "Harry Potter and the order of the phoenix (2003)", "Of mice and men (something something) (1937)")
title
To kill a mockingbird (1960)
Harry Potter and the order of the phoenix (2003)
Of mice and men (something something) (1937)
내가해야 할 것은 :
이Books$title <- c("To kill a mockingbird", "Harry Potter and the order of the phoenix", "Of mice and men (something something)")
Book$year <- c("1960", "2003", "1937")
title year
To kill a mockingbird 1960
Harry Potter and the order of the phoenix 2003
Of mice and men (something something) 1937
[재현 가능한 예] (https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) –