knitr fail compiling chunk with scan(dec=“,”)
问题 What I'm trying is import (copy&paste) some data from Excel with comma as decimal points by using scan(dec=",") command, but I have a problem with knitr when compiling this chunk: <<>>= conc<-scan(dec=",") 9,562445749 37,66119516 72,9103195 @ I get this error: Line 22: Unexpected ',' Thanks for your help 回答1: In this case scan() requires your to run it in an interactive fashion (e.g. it waits for a blank line to terminate input), whereas knitr / Sweave runs R code in a non-interactive fashion