-
Notifications
You must be signed in to change notification settings - Fork 979
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
Update datatable-intro.Rmd #6558
base: master
Are you sure you want to change the base?
Conversation
A powerful feature of data.table is the ability to store lists as elements (a facility not available in data.frame). Here is a simple illustration of storing a fitted model as data.table element. When statistical models are fit to different groups within a data.table, these models can be stored in a result data.table. Now this resulting data.table can be used to access fitted models.
note that this is not exactly true,
Having said that, of course it is much more convenient to use
|
please clarify your proposed addition by mentioning that it is possible in frame but requires a bit more typing, since you have to wrap lists with > data.table(L=list(1:2))
L
<list>
1: 1,2
> data.frame(L=list(1:2))
X1.2
1 1
2 2
> data.frame(L=I(list(1:2)))
L
1 1, 2 |
Illustrate creation and storage of models as lists within data.table Provide a counter-example using data.frames where code has more lines and is more difficult to understand.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6558 +/- ##
=======================================
Coverage 98.62% 98.62%
=======================================
Files 79 79
Lines 14450 14450
=======================================
Hits 14251 14251
Misses 199 199 ☔ View full report in Codecov by Sentry. |
that looks better thanks |
A powerful feature of data.table is the ability to store lists as elements (a facility not available in data.frame). Here is a simple illustration of storing a fitted model as data.table element.
When statistical models are fit to different groups within a data.table, these models can be stored in a result data.table. Now this resulting data.table can be used to access fitted models.