Requirements
You will need a Stata (*.dta) data set made available as a publicly accessible URL.
Method
This example uses a 2017 face-to-face post-election survey data set.
1. Select File > Data Sets > Add to Project > From R...
2. Enter a name for the data set in the Name field at the bottom of the window.
3. Paste the below R code in the R CODE editor:
library(haven)
# Import data
df = read_dta("http://www.britishelectionstudy.com/wp-content/uploads/2018/01/bes_f2f_2017_v1.2.dta")
# Convert as labels
df = as_factor(df)
4. Click the Play button.
5. Click Add Dataset.
6. Click OK.
In the code above we read in the data set using haven's read_dta function. Next, we convert the data set so that it displays the labels rather than the values.