R-csv에 쓸 때 오류

DenStudent

다음 데이터 세트가 있습니다.

 Artist Song.Rank          Song.Title      Word WordCount SentimentScore.text SentimentScore.sentiment
1  Placeholder        60 More Placeholders   alright        40             alright                  Neutral
2  Placeholder        60 More Placeholders       bad        79                 bad                 Negative
3  Placeholder        60 More Placeholders       bad       192                 bad                 Negative
4  Placeholder        60 More Placeholders    better       125              better                 Positive
5  Placeholder        60 More Placeholders     brand        24               brand                  Neutral
6  Placeholder        60 More Placeholders     break       106               break                 Negative
7  Placeholder        60 More Placeholders     cause        18               cause                  Neutral
8  Placeholder        60 More Placeholders      come        59                come                  Neutral

이 데이터 세트는 xlsx 파일의 데이터로 존재합니다. 마지막 열만 패키지 Sentiment를 사용하여 직접 추가 한 것 RSentiment입니다.

csv에 삽입하려고하면 다음 메시지가 표시됩니다.

> write.csv(dataset,"calculated.csv")
Error in if (inherits(X[[j]], "data.frame") && ncol(xj) > 1L) X[[j]] <- as.matrix(X[[j]]) : 
missing value where TRUE/FALSE needed

약간의 조사 끝에 내 데이터 세트에 중첩 된 데이터 프레임이 포함되어 있기 때문에 이런 일이 발생한다는 것을 알게되었지만 이와 같은 제안 된 솔루션 도움 되지 않았습니다. (이 경우 invalid subscript type 'closure'오류가 발생했습니다.)

편집하다 : 나는 이것이 묻는 많은 게시물을 보았다.

> str(dataset)
'data.frame':   28 obs. of  6 variables:
 $ Artist        : chr  "Placeholder" "Placeholder" "Placeholder" "Placeholder" ...
 $ Song.Rank     : num  60 60 60 60 60 60 60 60 60 60 ...
 $ Song.Title    : chr  "More Placeholder" "More Placeholder" "More Placeholder" "More Placeholder" ...
 $ Word          : chr  "alright" "bad" "bad" "better" ...
 $ WordCount     : num  40 79 192 125 24 106 18 59 138 146 ...
 $ SentimentScore:'data.frame': 28 obs. of  2 variables:
  ..$ text     : Factor w/ 23 levels "alright","bad",..: 1 2 2 3 4 5 6 7 8 9 ...
  ..$ sentiment: Factor w/ 3 levels "Negative","Neutral",..: 2 1 1 3 2 1 2 2 2 2 ...
tstev

여기서 중첩 된 data.frames를 원하지 않는다고 가정합니다. 그런 다음 다음과 같이하십시오.

new_dataset <- data.frame(subset(dataset, select = -c(SentimentScore)), 
                          dataset$SentimentScore)
write.csv(new_dataset, 
          file = "dataset.csv", 
          quote = FALSE)

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

파일에 쓸 때 오류

분류에서Dev

파일에 쓸 때 C 분할 오류

분류에서Dev

Access DB에 쓸 때 Java 오류

분류에서Dev

Skygear DB에 쓸 때 오류 401

분류에서Dev

셀에 쓸 때 openpyxl 값 오류

분류에서Dev

파일에 csv를 쓸 때 왜 오류가 발생합니까?

분류에서Dev

CSV에 쓸 때 "짧은 쓰기"오류를 해결하는 방법

분류에서Dev

CSV에 쓸 때 "짧은 쓰기"오류를 해결하는 방법

분류에서Dev

csv에 쓸 때 Python NameError

분류에서Dev

openfire db에 쓸 때 executeUpdate에서 오류 발생

분류에서Dev

const 전에 noexcept를 쓸 때 왜 오류가 발생합니까?

분류에서Dev

EMR을 통해 s3a에 쓸 때 OutOfMemory 오류

분류에서Dev

다른 SD 카드에 쓸 때 오류 발생

분류에서Dev

Swift로 핵심 데이터에 쓸 때 오류 코드 문제

분류에서Dev

오류, 파일에 쓸 때 긴 텍스트?

분류에서Dev

xls 파일에 쓸 때 오류-Apache POI 멀티 스레딩

분류에서Dev

RandomAccessFile에 쓸 때 NullPointerException

분류에서Dev

내 DB에 쓸 때

분류에서Dev

브라우저에 너무 많이 쓸 때 메모리 부족 오류 방지

분류에서Dev

Python 3 UTF-8을 파일에 쓸 때 오류를 무시하는 방법

분류에서Dev

R에서 플로팅 할 때 오류

분류에서Dev

파일에 쓸 때 unknownSource

분류에서Dev

docx에 쓸 때 kable 공백

분류에서Dev

SearchView에서 쓸 때 SuggestionsAdapter NullPointerException

분류에서Dev

파일에 쓸 때 UnicodeEncodeError

분류에서Dev

FIFO에 쓸 때 SIGPIPE 트랩

분류에서Dev

파이썬에서 텍스트 파일에 쓸 때 오류 [닫힌 파일에 대한 I / O 작업]

분류에서Dev

메모리가 제한된 시스템에서 큰 파일에 쓸 때 mapFailed () 오류를 피하는 방법

분류에서Dev

JS에서 파일에 쓸 때 "예기치 않은 토큰 :"오류 수정 방법

Related 관련 기사

  1. 1

    파일에 쓸 때 오류

  2. 2

    파일에 쓸 때 C 분할 오류

  3. 3

    Access DB에 쓸 때 Java 오류

  4. 4

    Skygear DB에 쓸 때 오류 401

  5. 5

    셀에 쓸 때 openpyxl 값 오류

  6. 6

    파일에 csv를 쓸 때 왜 오류가 발생합니까?

  7. 7

    CSV에 쓸 때 "짧은 쓰기"오류를 해결하는 방법

  8. 8

    CSV에 쓸 때 "짧은 쓰기"오류를 해결하는 방법

  9. 9

    csv에 쓸 때 Python NameError

  10. 10

    openfire db에 쓸 때 executeUpdate에서 오류 발생

  11. 11

    const 전에 noexcept를 쓸 때 왜 오류가 발생합니까?

  12. 12

    EMR을 통해 s3a에 쓸 때 OutOfMemory 오류

  13. 13

    다른 SD 카드에 쓸 때 오류 발생

  14. 14

    Swift로 핵심 데이터에 쓸 때 오류 코드 문제

  15. 15

    오류, 파일에 쓸 때 긴 텍스트?

  16. 16

    xls 파일에 쓸 때 오류-Apache POI 멀티 스레딩

  17. 17

    RandomAccessFile에 쓸 때 NullPointerException

  18. 18

    내 DB에 쓸 때

  19. 19

    브라우저에 너무 많이 쓸 때 메모리 부족 오류 방지

  20. 20

    Python 3 UTF-8을 파일에 쓸 때 오류를 무시하는 방법

  21. 21

    R에서 플로팅 할 때 오류

  22. 22

    파일에 쓸 때 unknownSource

  23. 23

    docx에 쓸 때 kable 공백

  24. 24

    SearchView에서 쓸 때 SuggestionsAdapter NullPointerException

  25. 25

    파일에 쓸 때 UnicodeEncodeError

  26. 26

    FIFO에 쓸 때 SIGPIPE 트랩

  27. 27

    파이썬에서 텍스트 파일에 쓸 때 오류 [닫힌 파일에 대한 I / O 작업]

  28. 28

    메모리가 제한된 시스템에서 큰 파일에 쓸 때 mapFailed () 오류를 피하는 방법

  29. 29

    JS에서 파일에 쓸 때 "예기치 않은 토큰 :"오류 수정 방법

뜨겁다태그

보관