Copy and Paste

Data can be copied in the Data Viewer of JGR. For a description of the Data Viewer, please refer the the section on how to enter data manually.

Consider the following data set:

Heights of 10 people (this will open the heights of ten people in a new browser tab).

and suppose the mean of these values is required.

Create a new data frame as described and define the variable name (height) and type (double).

Select the browser tab that contains the heights of 10 people, select the heights (but not the variable name “height” on top of the list) and copy the data to the clipboard (Ctrl-C).

In the Data Viewer, paste (Ctrl-V) the data into the browser window and the data are now available for analysis in R.

To calculate the mean, make the Console the active window and select Analysis and then Descriptives from the menu bar. This will create the following window:dialogue1

Select height and click on the Right Arrow to move it into the ‘Descriptives of’ box. Click ‘continue’ and make sure ‘Mean’ is named in the subsequent ‘Run Descriptives’ box:dialogue2

Selecting Run should provided the following output in the Console:

> descriptive.table(vars = d(height),data= heights,
+ func.names =c(“Mean”,”St. Deviation”,”Valid N”))
$`strata: all cases `
         Mean.height St. Deviation.height       Valid N.height
           165.88889             12.94647              9.00000

To save the data frame, select the save data frame icon:saveand save the file with an appropriate name in an appropriate location. Select *.RDA (R DAta file) as the file format.

The data frame can also be saved by selecting File and then Save Data from the menu bar when the Data Viewer is the active window.

Data frames can be opened by selecting the open data frame icon:open dataframeManoeuvre to the appropriate file location, select the file and load the data.

A previously saved data frame can also be loaded by selecting File and then Save Data from the menu bar when the Data Viewer is the active window.

 

Advanced Users

In the console enter:

mean(heights$height)

(where the data frame is called heights and the variable height)

[1] 165.8889