I need to replace this code and Dynamically assign rep(NA, n) for each attribute and value. How can I do it ? I tried below code but doesn't work. Please help.
This is the code need to be replaced -
Attribute_1_Value = Attribute_1_Name = Attribute_2_Value = Attribute_2_Name = Attribute_3_Value = Attribute_3_Name = rep(NA,n)
This is the code I tried but didn't work. It gives me error "value for ‘Attribute_1_Name’ not found "
for(i in 1:3)
{
tempName <- str_replace("Attribute_%d_Name", "%d", i)
tempName = rep(NA,n)
tempValue <- str_replace("Attribute_%d_Name", "%d", i)
tempValue = rep(NA,n)
}