I am having a problem of how to pass a concatenated strings that is similar to the name of the datasets in my global data. Name1 to Name12 is a dataset

```
Name1 3obs of 2variables

Name2 4obs of 2variables

...

Name12 2obs of 2variables

```

I want to simplify my code since so I made a for loop to print each dataset name

```
for(j in 1:12){
name<-paste("Name",j,sep="")
print(name)
}

```

after that I tried passing it to the function 

```
for(j in 1:12){
name<-paste("Name",j,sep="")
Greetings(name)
}

```

but i encounter

```
Error in name$gender : $ operator is invalid for atomic vectors

Greetings <- function(name){
check<-name$gender
if(check==male) cat("Greetings","Mr",name$person)
else cat("Greetings","Ms",name$person)
}

```