Skip to content

fread gains index argument for setting secondary indices#2719

Merged
mattdowle merged 4 commits intomasterfrom
fread_index_2633
Apr 9, 2018
Merged

fread gains index argument for setting secondary indices#2719
mattdowle merged 4 commits intomasterfrom
fread_index_2633

Conversation

@MichaelChirico
Copy link
Copy Markdown
Member

@MichaelChirico MichaelChirico commented Apr 1, 2018

Closes #2633

Also fleshed out some more details in ?fread about the order of arguments & improved the error for a bad key argument, and simplified the test for setindexv accepting a list

Comment thread R/fread.R Outdated
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to fix this, won't work correctly for atomic vector

@codecov-io
Copy link
Copy Markdown

codecov-io commented Apr 1, 2018

Codecov Report

Merging #2719 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2719      +/-   ##
==========================================
+ Coverage   93.41%   93.43%   +0.02%     
==========================================
  Files          61       61              
  Lines       12281    12295      +14     
==========================================
+ Hits        11472    11488      +16     
+ Misses        809      807       -2
Impacted Files Coverage Δ
R/fread.R 96.55% <100%> (+0.36%) ⬆️
R/utils.R 91.3% <0%> (+8.69%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bd1b282...de995f1. Read the comment docs.

Comment thread R/fread.R
if (!all(sapply(index, is.character)))
stop("index argument of data.table() must be a character vector naming columns (NB: col.names are applied before this)")
if (is.list(index)) {
to_split = sapply(index, length) == 1L
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess this should be vapply_1i

@mattdowle mattdowle added this to the v1.10.6 milestone Apr 9, 2018
@mattdowle mattdowle changed the title Closes #2633 -- fread gains index argument for setting secondary indices fread gains index argument for setting secondary indices Apr 9, 2018
Copy link
Copy Markdown
Member

@mattdowle mattdowle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. Especially that multi-column index can be specified either in c("col1","col2","col3") form or as "col1,col2,col3" and that both are acceptable is documented.

@mattdowle mattdowle merged commit fd7eb8d into master Apr 9, 2018
@mattdowle mattdowle deleted the fread_index_2633 branch April 9, 2018 23:15
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

Successfully merging this pull request may close these issues.

3 participants