Once you've created a document, the next thing to do is to add a file consisting of data table(s) to include in your report.
There are different ways of adding summary tables to a document using Data Stories:
- Importing an Excel file (.xlsx or .xls) consisting of summary tables. These could be data tables exported from Displayr or Q in Excel format, summary tables created using another program, or Excel tables that were manually created.
- Copy and paste as a table - for when you have a table of aggregated data that you would like to include in your report.
- Using code to create a custom R output importing either respondent-level summary tables or aggregated data.
- COMING SOON: Importing data with SQL queries.
- Importing a .QPack created in Q or Displayr.
Import an Excel file
- To import an Excel file, press Add Data (bottom-left of the screen) or click the + icon at the top right corner of the Data Source menu.
- Select Upload file or one of the cloud drive/URL options.
- Select the Excel file > Open.
Select Create Visualization, presentations or dashboards and click Next.
Data Stories will then scan through the Excel Workbook to organize all tables and import each one as a separate item in the Data Sources tree.
Copy and paste as a table
Tables of data can be copied and pasted from other apps (such as Excel) directly into Displayr. These can be tables of raw data, a table of aggregated data (such as a summary table), or any sort of information in table format.
You can paste your table directly onto the Page using the Paste (ctrl+ v) function.
Alternatively, you can create a standalone table on the Page by going to the toolbar, and clicking Table > Paste or Enter Table, and then pressing the Paste or type data button. Many visualizations also have a Paste or type data button inside the object inspector where you can paste your table of data to plot directly into the visualization. When data is added by pasting in, you can use it in other outputs, but many standard analyses are not available (e.g., our built-in stat testing). Consequently, if importing an entire data set, it is usually preferable to do so by adding the summary tables from Execl (see the previous section), rather than pasting.
Using code
You can write R code to add data to your Data Stories Document.
From the toolbar, click Calculation > Custom Code and click on the Page to place the output.
Next, input the R code for importing aggregated or raw data into a calculation/output directly on the page where you can manipulate it like any other table.
Importing data with SQL queries
See How to Import Data by Connecting to an SQL Database. This feature is coming soon.
Importing a QPack created in Q or Displayr
See How to Create a Displayr Document Using a QPack.
Note that with a Data Stories module only, the Document will only consist of outputs in the QPack (e.g., tables, visualizations, and calculations). To update the tables with different variables and access the Data Set, you need to upgrade to a full Displayr license.
If you have a full Displayr license and want to import a QPack as Excel tables, you must first export the tables from Displayr to Excel (via Share > Export Pages) and import the Excel file containing them.