You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using read_table for my file which is quite big. The first column doesn't have any column name. After read_table, it is moving the column names to left and it is giving a parsing issue, as the column names and length don't match. This ends up giving me the file in R with one missing column at last. Any way to read this file without losing the last column and the names. I tried read and it gave me only one variable instead of 1027 variables, even though I tried with different sep options.
Assuming your file is whitespace delimited (since you're using read_table), you might try read_delim instead, which will read in the first column with the missing column name and give a generic placeholder name (with a bunch of warnings):
> read_delim(I(" x\n1 2\n3 4"))
New names:
• `` -> `...1`
Rows: 2 Columns: 2
── Column specification ──────────────────────────────────────────────────────────────────────────
Delimiter: " "
dbl (2): ...1, x
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# A tibble: 2 × 2
...1 x
<dbl> <dbl>
1 1 2
2 3 4
I am using read_table for my file which is quite big. The first column doesn't have any column name. After read_table, it is moving the column names to left and it is giving a parsing issue, as the column names and length don't match. This ends up giving me the file in R with one missing column at last. Any way to read this file without losing the last column and the names. I tried read and it gave me only one variable instead of 1027 variables, even though I tried with different sep options.
The text was updated successfully, but these errors were encountered: