많은 줄이있는 json 파일을 읽어야합니다.R의 텍스트 파일에서 빈 줄을 제거하는 방법은 무엇입니까?
파일 중 일부에서 파일을 R (jsonlite 사용)로 읽으려고 할 때 오류가 발생하는 빈 줄을 보았습니다.
R을 사용하여 빈 줄을 제거하려면 어떻게해야합니까? 다음과 같이) I는 readlines 메쏘드를 사용 끝에 그래서
mouse","trial_index":92,"time_elapsed":255348,"internal_node_id":"0.0-3.0-2.0-27.0","subject":"693","answer":1},{"rt":-1,"stimulus":"/study_assets/creactive/static/images/bird.jpeg","key_press":-1,"block":"two-back","condition":"target","trial_type":"single-stim-mouse","trial_index":93,"time_elapsed":257160,"internal_node_id":"0.0-3.0-2.0-28.0","subject":"693","answer":0},{"rt":407,"stimulus":"/study_assets/creactive/static/images/bird.jpeg","key_press":"mouse","block":"two-back","condition":"distractor","trial_type":"single-stim-mouse","trial_index":94,"time_elapsed":257871,"internal_node_id":"0.0-3.0-2.0-29.0","subject":"693","answer":0}]
[{"rt":71,"key_press":"mouse","trial_type":"text","trial_index":0,"time_elapsed":74,"internal_node_id":"0.0-0.0","subject":"695"},{"rt":-1,"correct":false,"stimulus":"<DIV id=\"goNoGoFixationPoint\">+</DIV>","key_press":-1,"response":"fixation","trial_type":"categorize-mouse","trial_index":1,"time_elapsed":575,"internal_node_id":"0.0-1.0-0.0-0.0","subject":"695"}
을 read.table'여기
빈 라인 부분의 예()'하나는'blank.lines.skip = TRUE'을 설정할 수 있습니다 – jogo시도 할 때 다음과 같은 오류가 나타납니다 : {스캔 오류 (파일, 내용, nmax, sep, dec, quote, skip, nlines, na.strings, : 라인 2에는 111 개의 요소가 없습니다. –
입력이 테이블이 아닙니다!'sep = ...'(결국'sep = 'μ '') 및'stringsAsFactors = FALSE' – jogo