我有很多数字
preKId_2015 = c(242938L, 339402L, 361888L, 428033L, 442546L, 309790L, 355662L,
458179L, 465105L, 490383L, 524644L, 526614L, 539453L, 555516L,
569709L)
我有一个xml文件,元素之间已经有一些其他id值
<input-id>
"PreKId"
12344
33433
23343
93893
23333
</input-id>
我试图用2015年前KId_。我试过了
doc <- xmlParseDoc("C:/... ProjectKids/test12.xml")
nodes <- getNodeSet(doc, "//input-id")[[1]]
xmlValue(nodes) = replace(xmlValue(nodes),xmlValue(nodes),preKId_2015)
我收到警告,但什么都没发生
Warning message:
In replace(xmlValue(nodes), xmlValue(nodes),preKId_2015) :
number of items to replace is not a multiple of replacement length
需要帮助