Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cols or list in read_csv #1515

Open
Sibojang9 opened this issue Sep 6, 2023 · 1 comment
Open

Use cols or list in read_csv #1515

Sibojang9 opened this issue Sep 6, 2023 · 1 comment

Comments

@Sibojang9
Copy link

The list and cols arguments in read_csv seem to be interchangeable, and I cannot find a clear answer online. Any insight into this?

library(tidyverse)

 
read_csv(
  "a,b,c
  4,5,6"
,col_types = list(a = col_factor()))
#> # A tibble: 1 × 3
#>   a         b     c
#>   <fct> <dbl> <dbl>
#> 1 4         5     6


read_csv(
  "a,b,c
  4,5,6"
  ,  col_types = cols(a = col_factor()))
#> # A tibble: 1 × 3
#>   a         b     c
#>   <fct> <dbl> <dbl>
#> 1 4         5     6

Created on 2023-09-06 with reprex v2.0.2

@jxu
Copy link

jxu commented Oct 18, 2023

Documentation for cols says they're generally interchangable.
#1392 related?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants