-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
I construct a json data frame in a loop, like this:
papers = data.frame()
for (....) {
current_papers <- content %>% as.tbl_json %>%
enter_object("items") %>% gather_array() %>%
spread_values(title=jstring("title"),
snippet= jstring("snippet"),
link= jstring("link"),
displayLink=jstring("displayLink")) %>%
enter_object("pagemap","metatags") %>% gather_array() %>%
spread_values(creationdate=jstring(creationdate_field),
moddate=jstring(moddate_field))
papers <- rbind(papers,current_papers)
}this seems to work fine, (the data frame looks good)
but using "mutate" from dplyr on it, like this
papers <-
papers %>%
mutate(clickLink=paste0('=HYPERLINK("',link,'","link")'))gives a very strange error message
Error in `$<-.data.frame`(`*tmp*`, "..JSON", value = list(list(author = "Microsoft Office User", :
replacement has 9 rows, data has 40
Converting it to a dataframe first, does work:
papers %>% data.frame() %>%
mutate(clickLink=paste0('=HYPERLINK("',link,'","link")'))Is this a bug in tidyjson or do I do something wrong ?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels