Мне нужно заменить этот код и динамически назначить rep(NA, n) для каждого атрибута и значения. Как мне это сделать ? Я пробовал код ниже, но не работает. Пожалуйста помоги.
Это код нужно заменить -
Attribute_1_Value = Attribute_1_Name = Attributefor(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)
}
Value = Attributefor(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)
}
Name = Attribute_3_Value = Attribute_3_Name = rep(NA,n)
Это код, который я пробовал, но не работал. Выдает ошибку "значение для ‘Attribute
Attribute_1_Value = Attribute_1_Name = Attributefor(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)
}
Value = Attributefor(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)
}
Name = Attribute_3_Value = Attribute_3_Name = rep(NA,n)
Name’ не найдено" 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)
}
n
? - person steveb   schedule 23.01.2016