I was wondering which are the posibilities of vectorizing an array of vector using the for-loop.
The general idea is:
- Vector names
- Vector values
- Assign each values from 2 in each 1
As and example I've tried:
Names <- c('Arnold','Jhon' ,'Jim','Jason')`
Surnames <- c('Palmer','Kramer' ,'Carrey','Momoa')`
for (Name in Names){
for (Surname in Surname){
Name <- Surname
}
}
What I'm expecting is to create multiple vector named from each individual value form the chracter string Names and each one of this new individual vectors assigned with each surname in Surnames. This would be like:
>Arnold
[1] "Palmer"
>Jhon
[1] "Kramer"
Definitely this isn't working, and I've been searching widebroad in the web, and although there are similar results, there is one that could be, with some modifications obviously, applied to my model. So if you know any other posted questions or any solution I'd be very gladly with you.