Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

df inside df not converted to JSON correctly #38

Closed
SymbolixAU opened this issue Jan 29, 2019 · 0 comments
Closed

df inside df not converted to JSON correctly #38

SymbolixAU opened this issue Jan 29, 2019 · 0 comments
Assignees
Labels
bug
Milestone

Comments

@SymbolixAU
Copy link
Owner

@SymbolixAU SymbolixAU commented Jan 29, 2019

df <- structure(list(`_id` = 1, details = structure(list(
  val1 = "a", 
  val2 = "b", 
  val3 = "c", 
  val4 = "d", 
  val5 = "e"), 
  class = "data.frame", row.names = 1L)), class = "data.frame", row.names = 1L)

df
to_json( df )

Similarly

details <- data.frame(
  val1 = c("a")
  , val2 = c("b")
  , val3 = c("c")
  , stringsAsFactors = FALSE
)

df2 <- data.frame(
  id = 1
  , details = I(details)
)

And noting

details <- data.frame(
  val1 = c("a","b")
  , val2 = c("b","c")
  , val3 = c("c","d")
  , stringsAsFactors = FALSE
)

df2 <- data.frame(
  id = 1
  , details = I(details)
)

Doesn't print correctly, BUT, is a valid R structure (I think?)

@SymbolixAU SymbolixAU self-assigned this Jan 29, 2019
@SymbolixAU SymbolixAU added this to the v0.2.1 milestone Jan 29, 2019
@SymbolixAU SymbolixAU added the bug label Jan 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.