Once you've created a document (see How to Create a New Document in Displayr), the next thing to do is add some data to it to analyze.
Adding data to the document
There are four basic ways of adding data to a document:
- Add as a data set - for when you have a data file or raw data that you want to work with.
- Copy and paste as a table - for when you have a table of aggregated data that you would like to include in your report.
- Use Code - to load data in any shape either as a data set or as raw or aggregated data that you want to manipulate with R in a separate output.
- Add Miscellaneous Data using a Widget
Add as a data set
Most data analyses in Displayr involve the use of a data set. For example, with surveys, data sets typically contain the responses from each person to complete a survey. To connect Displayr to a data set, press Add Data (bottom-left of the screen).
You can then choose from the various ways of uploading or connecting to data.
If you have a data file saved on your computer, then the option to go for is My Computer. Displayr can also connect to a range of other cloud services, e.g. Google Drive and Dropbox, as well as connecting directly with some popular data collection platforms like Qualtrics. For full details on the different options, see How to Import Data into Displayr.
If you are relatively new to analyzing survey data, please read Find the Best Possible Data File before proceeding, as a lot of time can be saved by making sure you have the best possible file format.
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 create a standalone table on the Page through the Table icon > Paste or Enter Table and the Paste or type data button. Many visualizations also have a Paste or type data button inside their object inspector where you can paste in 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 data set (see the previous section), rather than pasting.
Use Code
You can write code to add data to your Displayr Document. There are a variety of ways of doing this, including:
-
- You can create a custom calculation and write code for importing aggregated or raw data into a calculation/output directly on the page where you can manipulate it as any other table.
- You can add a data set, choose the R option, and then write code to import the data set into the Data Sources of the document.
- You can use the Displayr API.
Add Miscellaneous Data using a Widget
Currently, Displayr has a function to load stock prices. See How to Import and Analyze Stock Price Data for more on this.
Next
Once you have the data in Displayr, the next step is to Check Your Data.