나는 다음과 같다 다음 데이터 프레임 (정보)이 : 클래스 형으로R : CSV로 목록 출력 데이터 프레임
> info[1:5,]
field BinningMethod DataType numLevels cumLevel factLevels
1 data_len EQUAL AREA DOUBLE 5 5 (-inf,2.0], (2.0,6.0), [6.0,8.0), [8.0,+inf), MISSING
2 dns_count_add_rr DISCRETE MAPPING DOUBLE 3 8 0.0, 1.0, MISSING
3 dns_count_answers DISCRETE MAPPING DOUBLE 3 11 0.0, 1.0, MISSING
4 dns_count_auth_rr DISCRETE MAPPING DOUBLE 3 14 0.0, 1.0, MISSING
5 dns_count_queries DISCRETE MAPPING DOUBLE 2 16 1.0, MISSING
:
> sapply(info, class)
field BinningMethod DataType numLevels cumLevel factLevels
"character" "character" "character" "numeric" "numeric" "list"
내가 원하는 출력을 'info'를 CSV 파일에 저장하지만 목록 필드 (factLevels)를 처리하는 방법을 모릅니다. 현재 다음 오류가 발생합니다.
> write.csv(info,
+ file = paste("FIELDS_", modelFile, sep=""),
+ row.names = FALSE, na = "")
Error in write.table(x, file, nrow(x), p, rnames, sep, eol, na, dec, as.integer(quote), : unimplemented type 'list' in 'EncodeElement'
어떤 해결책이 있습니까? 내가 가지고있는 유일한 요구 사항은 자바 프로그램에서 그것을 읽고 다른 값들을 구분할 수 있어야한다는 것이다.
이렇게하면됩니다. 목록을 하나의 문자열에 넣을 때 'as.character'호출을 제거했습니다. 그것없이, 붙여 넣기 기능은 이제 제대로 작동합니다. 감사. – bnjmn
@ 벤자민 저를 시정 해 주셔서 감사합니다! – joran