Looping through vector of variable names and applying a function (in R)
<p>so I already found some related topics but somehow failed to apply them to my case. Actually I think this one s quite straightforward:
I am trying to write a loop that will show me all unique values for each of the variables of a given data frame (let s call it "data"). I am therefore trying to apply the unqiue() fct. Here is how I thought it d work out:</p>

<pre><code>i=0 
for (name in names(data)) {i=i+1; print(get(paste0((unique(names(data)[i])))))}
</code></pre>

<p>Guess I havent yet figured out the correct usage of get/assign/paste.</p>

<p>Any help? Thanks in advance</p>