From 6ea4d2653fba8b263f9385859eb9c7264b0dbd27 Mon Sep 17 00:00:00 2001 From: Symbolics Date: Fri, 19 Nov 2021 15:54:35 +0800 Subject: [PATCH] Fixed more variable package access references --- content/en/docs/Tasks/data-frame.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/content/en/docs/Tasks/data-frame.md b/content/en/docs/Tasks/data-frame.md index b05be8e..bc6421b 100644 --- a/content/en/docs/Tasks/data-frame.md +++ b/content/en/docs/Tasks/data-frame.md @@ -1043,7 +1043,7 @@ function. Using the `mtcars-small` data frame, defined in [export data frames](/docs/tasks/data-frame/#export-data-frames) above: ```lisp -(column mtcars-small 'mpg) +(column mtcars-small 'mtcars:mpg) ;; #(21 21 22.8d0 21.4d0 18.7d0) ``` @@ -1068,7 +1068,7 @@ To get all the columns as a vector, use the `columns` function: You can also return a subset of the columns by passing in a selection: ```lisp -(columns mtcars-small '(mpg wt)) +(columns mtcars-small '(mtcars:mpg mtcars:wt)) ;; #(#(21 21 22.8d0 21.4d0 18.7d0) #(2.62d0 2.875d0 2.32d0 3.215d0 3.44d0)) ``` @@ -1529,10 +1529,18 @@ condition. For example if you want to know how many cars have a MPG (miles-per-galleon) rating greater than 20, you could use: ```lisp -(count-rows mtcars 'mpg #'(lambda (x) (< 20 x))) +(use-package 'mtcars) +(count-rows mtcars 'mtcars:mpg #'(lambda (x) (< 20 x))) ; => 14 ``` +Notice the first line `(use-package 'mtcars)`. This makes all of the +symbols that name variables accessible in the LS-USER package. For +large projects, you might want to configure the data frame package, +for example importing `CL` and doing your work from there. This is +mostly useful when you have several large, complicated datasets and +want to work with all of them at the REPL. + ### do-rows `do-rows` applies a function on selected variables. The function must