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
Vignette only about special symbols sounds cryptic. Maybe vignette about complex queries, which will cover special symbols and tricks like { inside j, or newcol := { ... }. Printing from j. Grouping columns being length 1 inside j. Combining columns with .SD list c(list(col=f1(col1)), lapply(.SD, f2), list(col5=f3(col1))).
Because the choice of data is mentioned: in general, I think it's better with minimal data sets in examples and vignettes - so much easier to track results following each step of code. To be honest, I don't think we need 253316 rows (flights) or 44963 (Pitching) to explain and demonstrate the actual functionality of .SD (or other data.table functions for that sake) ;)
Benchmarking on large data sets could be provided in a separate vignette.
253K and 45K rows are tiny in the grand scheme of things. They are trivially small to fread:
system.time(fread('vignettes/flights14.csv'))
# user system elapsed
# 0.102 0.012 0.037
library(data.table)
library(Lahman)
Pitching = as.data.table(Pitching)
Pitching = Pitching[ , .(playerID, yearID, teamID, W, L, G, ERA)]
tmp = tempfile()
system.time({fwrite(Pitching, tmp); fread(tmp)})
# user system elapsed
# 0.020 0.002 0.023
Could we use a subset of the data? Sure, if we're careful to preserve reproducibility. In terms of "tracking results", this is easily superable -- vignette writer can drill down to a specific group as needed.
Practical examples are strictly superior to contrived ones. Using foo and bar IMO is the quickest way to ensure a vignette stays unread. flights✈️ data is pretty universal & easy to understand... Lahman baseball ⚾️ data is a bit more niche but I don't think the basic analysis gets too abstruse and things like ERA can be meaningfully conveyed a few words.
They are not tiny for human eye, I think this is what @Henrik-P mean. If we can have 20-40 rows data to present same functionality, then it will be easier for readers to follow.
I'm going to stick with the original data. I think small data is good for the examples section in documentation; vignettes (to me) are about telling/writing a story, a sort of interactive blog post.
Since Lahman is on Github, I'll just download.file/load the data & direct users to the package & original website as proper citation.
Activity
arunsrinivasan commentedon Feb 17, 2019
Sounds great! Why not go for a "special symbols" vignette altogether? Could you not use the same flights data we already use though?
jangorecki commentedon Feb 18, 2019
Vignette only about special symbols sounds cryptic. Maybe vignette about complex queries, which will cover special symbols and tricks like { inside j, or
newcol := { ... }. Printing from j. Grouping columns being length 1 inside j. Combining columns with .SD listc(list(col=f1(col1)), lapply(.SD, f2), list(col5=f3(col1))).Henrik-P commentedon Feb 18, 2019
Because the choice of data is mentioned: in general, I think it's better with minimal data sets in examples and vignettes - so much easier to track results following each step of code. To be honest, I don't think we need 253316 rows (flights) or 44963 (Pitching) to explain and demonstrate the actual functionality of
.SD(or otherdata.tablefunctions for that sake) ;)Benchmarking on large data sets could be provided in a separate vignette.
Just my 2c.
MichaelChirico commentedon Apr 3, 2019
@Henrik-P I have to disagree.
fread:Could we use a subset of the data? Sure, if we're careful to preserve reproducibility. In terms of "tracking results", this is easily superable -- vignette writer can drill down to a specific group as needed.
fooandbarIMO is the quickest way to ensure a vignette stays unread.flightsLahmanbaseball ⚾️ data is a bit more niche but I don't think the basic analysis gets too abstruse and things likeERAcan be meaningfully conveyed a few words.jangorecki commentedon Apr 3, 2019
They are not tiny for human eye, I think this is what @Henrik-P mean. If we can have 20-40 rows data to present same functionality, then it will be easier for readers to follow.
MichaelChirico commentedon May 9, 2019
I'm going to stick with the original data. I think small data is good for the
examplessection in documentation; vignettes (to me) are about telling/writing a story, a sort of interactive blog post.Since
Lahmanis on Github, I'll justdownload.file/loadthe data & direct users to the package & original website as proper citation.Closes #3412 -- adds .SD vignette from SO answer