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
Copy file name to clipboardExpand all lines: vignettes/datatable-joins.Rmd
+9-24Lines changed: 9 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -42,37 +42,22 @@ To illustrate how to use the method available with real life examples, let's sim
42
42
43
43
1.`Products`, a table with rows giving characteristics of various products. To show how the framework deals with ***missing values***, one `id` is `NA`.
44
44
45
-
```{r define_products}
46
-
Products = data.table(
47
-
id = c(1:4,
48
-
NA_integer_),
49
-
name = c("banana",
50
-
"carrots",
51
-
"popcorn",
52
-
"soda",
53
-
"toothpaste"),
54
-
price = c(0.63,
55
-
0.89,
56
-
2.99,
57
-
1.49,
58
-
2.99),
59
-
unit = c("unit",
60
-
"lb",
61
-
"unit",
62
-
"ounce",
63
-
"unit"),
64
-
type = c(rep("natural", 2L),
65
-
rep("processed", 3L))
45
+
```{r, define_products}
46
+
Products = rowwiseDT(
47
+
id=, name=, price=, unit=, type=,
48
+
1L, "banana", 0.63, "unit", "natural",
49
+
2L, "carrots", 0.89, "lb", "natural",
50
+
3L, "popcorn", 2.99, "unit", "processed",
51
+
4L, "soda", 1.49, "ounce", "processed",
52
+
NA, "toothpaste", 2.99, "unit", "processed"
66
53
)
67
-
68
-
Products
69
54
```
70
55
71
56
2.`NewTax`, a table with rows defining some taxes associated with processed products based on their units.
0 commit comments