Skip to content
Advertisement

Assign multiple variables from a list of file names

I have a list of file

JavaScript

and a list of variables names

JavaScript

I want to assign every item in var_names a read_spss function.

so that ill get

JavaScript

Thanks

Advertisement

Answer

Like the comment above the easiest way to do this is with a dictionary.

JavaScript

That way then you can just access it like this files['var1'] to get the content of file1.sav1.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement