Ik zou zeggen, doe dit:
getDat();
Dan krijg je een dialoogje waarin je het bestand zelf kunt zoeken en selecteren. Hij vertelt je daarna ook wat het correcte commando is dat je kunt gebruiken om rechtstreeks, zonder dialoogje, te laden.
In mijn geval bijvoorbeeld:
> getDat()
You did not specify a file to open. Therefore, please select the file to open in the File Selection Dialog. Note that this dialog can sometimes appear behind the R window. If you do not see the file dialog now, use ALT-TAB or check the start bar (in Windows), use COMMAND-TAB (in OSX), or check the dock (in *nux based systems such as Ubuntu or OS X).
You have selected a file. Based on your call and the filename and directory (path) you selected, this is the command you can use to read the datafile without a dialog, for example in an R script:
getData(filename="B:/Data/teaching/OU/Courses/git/onderzoekspracticum-inleiding-data-analyse/Datafiles/Statistiek_Angst.sav");
The data has been stored in a dataframe called 'dat'. That means that if you want to repeat this command and store the dataframe with the same name, you have to use:
dat <- B:\Data\teaching\OU\Courses\git\onderzoekspracticum-inleiding-data-analyse\Datafiles\Statistiek_Angst.sav;
Warning message:
In getDat() :
NOTE: an object called 'dat' already existed; I renamed it to 'dat_backup_20171222_163654'.
Ik zie nu trouwens dat hier nog een fout in staat: deze regel:
dat <- B:\Data\teaching\OU\Courses\git\onderzoekspracticum-inleiding-data-analyse\Datafiles\Statistiek_Angst.sav;
Moet eigenlijk zijn:
dat <- getData('B:\Data\teaching\OU\Courses\git\onderzoekspracticum-inleiding-data-analyse\Datafiles\Statistiek_Angst.sav');
Dus, 'getData', de haakjes, en de apostrofes moeten er nog bij.