如果我理解正確OP的16位識別碼,就是要式的人物。
但是,fread()
確定某些示例行的列類型(有關詳細信息,請參閱?fread
)。顯然,它試圖爲integer64
讀取數據。該colClasses
參數可用於通過fread()
覆蓋所做的猜測:
DT <- fread("1100110011001100
1100110011001100", colClasses = "character")
DT
# V1
#1: 1100110011001100
#2: 1100110011001100
如果verbose
參數設置爲TRUE
,fread()
揭示了它的一些內部運作的:
DT <- fread("1100110011001100
1100110011001100", colClasses = "character", verbose = TRUE)
Input contains a \n (or is ""). Taking this to be text input (not a filename)
Detected eol as \n only (no \r afterwards), the UNIX and Mac standard.
Positioned on line 1 after skip or autostart
This line is the autostart and not blank so searching up for the last non-blank ... line 1
Detecting sep ... Deducing this is a single column input.
Starting data input on line 1 (either column names or first row of data). First 10 characters: 1100110011
Some fields on line 1 are not type character (or are empty). Treating as a data row and using default column names.
Count of eol: 2 (including 0 at the end)
ncol==1 so sep count ignored
Type codes (point 0): 2
Column 1 ('V1') was detected as type 'integer64' but bumped to 'character' as requested by colClasses
Type codes: 4 (after applying colClasses and integer64)
Type codes: 4 (after applying drop or select (if supplied)
Allocating 1 column slots (1 - 0 dropped)
Read 2 rows. Exactly what was estimated and allocated up front
0.000s ( 0%) Memory map (rerun may be quicker)
0.000s ( 0%) sep and header detection
0.000s ( 0%) Count rows (wc -l)
0.000s ( 0%) Column type detection (100 rows at 10 points)
0.000s ( 0%) Allocation of 2x1 result (xMB) in RAM
0.000s ( 0%) Reading data
0.000s ( 0%) Allocation for type bumps (if any), including gc time if triggered
0.000s ( 0%) Coercing data already read in type bumps (if any)
0.000s ( 0%) Changing na.strings to NA
0.001s Total
這可能有助於分析用12位數字代碼讀取變量的問題。
來源
2017-01-16 12:02:02
Uwe