{"action":"created","issue":{"url":"https://api.github.com/repos/nutterb/pixiedust/issues/62","repository_url":"https://api.github.com/repos/nutterb/pixiedust","labels_url":"https://api.github.com/repos/nutterb/pixiedust/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/nutterb/pixiedust/issues/62/comments","events_url":"https://api.github.com/repos/nutterb/pixiedust/issues/62/events","html_url":"https://github.com/nutterb/pixiedust/issues/62","id":160648363,"number":62,"title":"Numeric representation when `options()$scipen` has been changed","user":{"login":"nutterb","id":1848445,"avatar_url":"https://avatars.githubusercontent.com/u/1848445?v=3","gravatar_id":"","url":"https://api.github.com/users/nutterb","html_url":"https://github.com/nutterb","followers_url":"https://api.github.com/users/nutterb/followers","following_url":"https://api.github.com/users/nutterb/following{/other_user}","gists_url":"https://api.github.com/users/nutterb/gists{/gist_id}","starred_url":"https://api.github.com/users/nutterb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nutterb/subscriptions","organizations_url":"https://api.github.com/users/nutterb/orgs","repos_url":"https://api.github.com/users/nutterb/repos","events_url":"https://api.github.com/users/nutterb/events{/privacy}","received_events_url":"https://api.github.com/users/nutterb/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-16T12:22:16Z","updated_at":"2016-06-17T11:06:52Z","closed_at":"2016-06-17T11:06:52Z","body":"In an e-mail from a user I received the following report\r\n\r\n* Trying to produce the latex code for a table from R using pixiedust\r\n  * values in table vary widely from 1.0e4 to 1e-7, therefore for\r\n    consistency I've forced them all to scientific notation using\r\n    \"options(scipen=-10)\"\r\n  * however when I run this code at the end\r\n\r\nstuff <- results.print %>%\r\n     dust %>%\r\n     sprinkle_print_method(\"latex\") %>%\r\n     sprinkle(font_size=6) %>%\r\n     print(asis = FALSE) %>%\r\n     cat()\r\n\r\n  * the latex code created has the fonts set as \"6e+00pt\" which latex\r\n    doesn't like\r\n  * alternatively if I reset the scipen back to the default by running\r\n    \"options(scipen=0)\" , just prior to this code then the font\r\n    specification in the latex code comes out correctly, but the values\r\n    in the table are changed back to a mix of scientific and regular\r\n    notation\r\n\r\n\r\n> results.print <- results2[289:325, ]\r\n > head(results.print)\r\n     timestep walk-area       date     rain     temp       Ep Qt\r\n289      289        BC 2013-10-16 2.85e-02 9.25e+00 8.58e-04 4.500e+02\r\n290      290        BC 2013-10-17 1.05e-03 1.10e+01 9.44e-04 7.519e+03\r\n291      291        BC 2013-10-18 3.33e-02 1.09e+01 9.23e-04 4.736e+04\r\n292      292        BC 2013-10-19 2.38e-02 1.29e+01 1.03e-03 1.273e+06\r\n293      293        BC 2013-10-20 1.59e-02 1.20e+01 9.58e-04 3.581e+02\r\n294      294        BC 2013-10-21 1.87e-02 1.24e+01 9.74e-04 4.773e+03\r\n            qt        qo        qs        qv     Smean\r\n289 2.583e-05 2.115e-05 4.682e-06 2.714e-02 3.606e-02\r\n290 4.317e-04 6.860e-07 4.310e-04 1.934e-04 3.630e-02\r\n291 2.719e-03 2.305e-03 4.143e-04 3.009e-02 6.618e-03\r\n292 7.307e-02 1.479e-02 5.827e-02 8.069e-03 5.682e-02\r\n293 2.056e-05 7.015e-06 1.354e-05 1.482e-02 4.201e-02\r\n294 2.740e-04 1.143e-04 1.598e-04 1.767e-02 2.451e-02  > stuff <- results.print %>%\r\n+     dust %>%\r\n+     sprinkle_print_method(\"latex\") %>%\r\n+     sprinkle(font_size=6L) %>%\r\n+     print(asis = FALSE) %>%\r\n+     cat()\r\n\\setlength{\\tabcolsep}{6e+00pt}\r\n  \\begin{table}\r\n\\centering\r\n\r\n\\label{tab:pixie-0e+00}\\begin{tabular}{lllrrrrrrrrr}\r\n   \\multicolumn{1e+00}{l}{timestep} & \\multicolumn{1e+00}{l}{walk-area} & \\multicolumn{1e+00}{l}{date} & \\multicolumn{1e+00}{r}{rain} & \\multicolumn{1e+00}{r}{temp} & \\multicolumn{1e+00}{r}{Ep} & \\multicolumn{1e+00}{r}{Qt} & \\multicolumn{1e+00}{r}{qt} & \\multicolumn{1e+00}{r}{qo} & \\multicolumn{1e+00}{r}{qs} & \r\n\\multicolumn{1e+00}{r}{qv} & \\multicolumn{1e+00}{r}{Smean}   \\\\\r\n\r\n\r\nThe following elements need to be guarded against scientific notation representations\r\n\r\n- [x] font size\r\n- [x] border thickness\r\n- [x] cell height\r\n- [x] cell width\r\n- [x] tabcolsep\r\n- [x] column span\r\n- [x] row span\r\n- [x] label numbering\r\n- [x] longtable (when a numeric is passed, it should be an integer)\r\n- [x] merge_rowval (should be an integer)\r\n- [x] merge_colval (should be an integer)\r\n- [x] pad\r\n- [x] rotate_degree\r\n\r\nProbably the easiest thing to do is store them in the internal structure as integers?  Does that work for values that could theoretically accept a decimal?"},"comment":{"url":"https://api.github.com/repos/nutterb/pixiedust/issues/comments/226742550","html_url":"https://github.com/nutterb/pixiedust/issues/62#issuecomment-226742550","issue_url":"https://api.github.com/repos/nutterb/pixiedust/issues/62","id":226742550,"user":{"login":"nutterb","id":1848445,"avatar_url":"https://avatars.githubusercontent.com/u/1848445?v=3","gravatar_id":"","url":"https://api.github.com/users/nutterb","html_url":"https://github.com/nutterb","followers_url":"https://api.github.com/users/nutterb/followers","following_url":"https://api.github.com/users/nutterb/following{/other_user}","gists_url":"https://api.github.com/users/nutterb/gists{/gist_id}","starred_url":"https://api.github.com/users/nutterb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nutterb/subscriptions","organizations_url":"https://api.github.com/users/nutterb/orgs","repos_url":"https://api.github.com/users/nutterb/repos","events_url":"https://api.github.com/users/nutterb/events{/privacy}","received_events_url":"https://api.github.com/users/nutterb/received_events","type":"User","site_admin":false},"created_at":"2016-06-17T11:06:52Z","updated_at":"2016-06-17T11:06:52Z","body":"Under 0.7.4, \r\n\r\n```r\r\nlibrary(pixiedust)\r\nDF <- \r\nstructure(list(timestep = 289:294, walk.area = c(\"BC\", \"BC\", \r\n\"BC\", \"BC\", \"BC\", \"BC\"), date = c(\"2013-10-16\", \"2013-10-17\", \r\n\"2013-10-18\", \"2013-10-19\", \"2013-10-20\", \"2013-10-21\"), rain = c(2.85e-02, \r\n1.05e-03, 3.33e-02, 2.38e-02, 1.59e-02, 1.87e-02), temp = c(9.25e+00, \r\n1.1e+01, 1.09e+01, 1.29e+01, 1.2e+01, 1.24e+01), Ep = c(8.58e-04, \r\n9.44e-04, 9.23e-04, 1.03e-03, 9.58e-04, 9.74e-04), Qt = c(4.5e+02, \r\n7.519e+03, 4.736e+04, 1.273e+06, 3.581e+02, 4.773e+03), qt = c(2.583e-05, \r\n4.317e-04, 2.719e-03, 7.307e-02, 2.056e-05, 2.74e-04), qo = c(2.115e-05, \r\n6.86e-07, 2.305e-03, 1.479e-02, 7.015e-06, 1.143e-04), qs = c(4.682e-06, \r\n4.31e-04, 4.143e-04, 5.827e-02, 1.354e-05, 1.598e-04), qv = c(2.714e-02, \r\n1.934e-04, 3.009e-02, 8.069e-03, 1.482e-02, 1.767e-02), Smean = c(3.606e-02, \r\n3.63e-02, 6.618e-03, 5.682e-02, 4.201e-02, 2.451e-02)), .Names = c(\"timestep\", \r\n\"walk.area\", \"date\", \"rain\", \"temp\", \"Ep\", \"Qt\", \"qt\", \"qo\", \r\n\"qs\", \"qv\", \"Smean\"), class = \"data.frame\", row.names = c(NA, \r\n-6L))\r\n\r\noptions(scipen = -10)\r\n\r\ndust(DF) %>%\r\n  sprinkle_print_method(\"html\") %>%\r\n  sprinkle(font_size=6) %>%\r\n  sprinkle(cols = 1:2,\r\n           rows = 1:2,\r\n           merge_rowval = 2,\r\n           merge_colval = 2,\r\n           merge = TRUE)\r\n```"}}
{"actor":{"display_login":"nutterb"}}