{"action":"closed","issue":{"url":"https://api.github.com/repos/julia-wrobel/registr/issues/2","repository_url":"https://api.github.com/repos/julia-wrobel/registr","labels_url":"https://api.github.com/repos/julia-wrobel/registr/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/julia-wrobel/registr/issues/2/comments","events_url":"https://api.github.com/repos/julia-wrobel/registr/issues/2/events","html_url":"https://github.com/julia-wrobel/registr/issues/2","id":293727049,"number":2,"title":"vignette error","user":{"login":"corybrunson","id":7768027,"avatar_url":"https://avatars1.githubusercontent.com/u/7768027?v=4","gravatar_id":"","url":"https://api.github.com/users/corybrunson","html_url":"https://github.com/corybrunson","followers_url":"https://api.github.com/users/corybrunson/followers","following_url":"https://api.github.com/users/corybrunson/following{/other_user}","gists_url":"https://api.github.com/users/corybrunson/gists{/gist_id}","starred_url":"https://api.github.com/users/corybrunson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corybrunson/subscriptions","organizations_url":"https://api.github.com/users/corybrunson/orgs","repos_url":"https://api.github.com/users/corybrunson/repos","events_url":"https://api.github.com/users/corybrunson/events{/privacy}","received_events_url":"https://api.github.com/users/corybrunson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-01T23:58:09Z","updated_at":"2018-02-02T19:13:37Z","closed_at":"2018-02-02T19:13:37Z","author_association":"NONE","body":"On knitting the vignette i hit a small error, which i've summarized below (with my own `sessionInfo()`):\r\n\r\n``` r\r\nlibrary(registr)\r\nlibrary(dplyr)\r\n#> \r\n#> Attaching package: 'dplyr'\r\n#> The following objects are masked from 'package:stats':\r\n#> \r\n#>     filter, lag\r\n#> The following objects are masked from 'package:base':\r\n#> \r\n#>     intersect, setdiff, setequal, union\r\nlibrary(ggplot2)\r\nsessionInfo()\r\n#> R version 3.3.2 (2016-10-31)\r\n#> Platform: x86_64-apple-darwin13.4.0 (64-bit)\r\n#> Running under: OS X Mavericks 10.9.5\r\n#> \r\n#> locale:\r\n#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8\r\n#> \r\n#> attached base packages:\r\n#> [1] stats     graphics  grDevices utils     datasets  methods   base     \r\n#> \r\n#> other attached packages:\r\n#> [1] ggplot2_2.2.1.9000 dplyr_0.7.4        registr_0.1       \r\n#> \r\n#> loaded via a namespace (and not attached):\r\n#>  [1] Rcpp_0.12.15      knitr_1.18        bindr_0.1        \r\n#>  [4] magrittr_1.5      splines_3.3.2     munsell_0.4.3    \r\n#>  [7] colorspace_1.3-2  R6_2.2.2          rlang_0.1.6.9003 \r\n#> [10] plyr_1.8.4        stringr_1.2.0     tools_3.3.2      \r\n#> [13] grid_3.3.2        gtable_0.2.0      withr_2.1.1.9000 \r\n#> [16] htmltools_0.3.6   lazyeval_0.2.1    yaml_2.1.16      \r\n#> [19] assertthat_0.2.0  rprojroot_1.3-2   digest_0.6.14    \r\n#> [22] tibble_1.4.2      bindrcpp_0.2      purrr_0.2.4      \r\n#> [25] tidyr_0.7.2       glue_1.2.0        evaluate_0.10.1  \r\n#> [28] rmarkdown_1.8     stringi_1.1.6     pillar_1.1.0     \r\n#> [31] scales_0.5.0.9000 backports_1.1.2   boot_1.3-20      \r\n#> [34] pkgconfig_2.0.1\r\nfpca_data = simulate_functional_data(I = 100, D = 200)\r\nY = fpca_data$Y\r\npc_df = data.frame(pop_mean = fpca_data$alpha, \r\n                   psi1 = fpca_data$psi1,\r\n                   psi2 = fpca_data$psi2,\r\n                   index = seq(0, 1, length.out = 200),\r\n                   id = 1)\r\nbfpca_object = bfpca(fpca_data$Y, npc = 2, Kt = 8, print.iter = TRUE)\r\n#> current iteration: 1\r\n#> current error: 100\r\n#> current iteration: 2\r\n#> current error: 7.46139390691072\r\n#> current iteration: 3\r\n#> current error: 5.36360041515815\r\n#> current iteration: 4\r\n#> current error: 0.736588648381846\r\n#> current iteration: 5\r\n#> current error: 0.141123511845482\r\n#> current iteration: 6\r\n#> current error: 0.0528979518549368\r\n#> current iteration: 7\r\n#> current error: 0.0261549215886246\r\n#> current iteration: 8\r\n#> current error: 0.0152654597821408\r\n#> current iteration: 9\r\n#> current error: 0.0099486416630379\r\n#> current iteration: 10\r\n#> current error: 0.00699015439921455\r\n#> current iteration: 11\r\n#> current error: 0.00517540083860305\r\n#> current iteration: 12\r\n#> current error: 0.00397781621072642\r\n#> current iteration: 13\r\n#> current error: 0.00314286307931933\r\n#> current iteration: 14\r\n#> current error: 0.00253598531387938\r\n#> current iteration: 15\r\n#> current error: 0.00208054812699585\r\n#> current iteration: 16\r\n#> current error: 0.00173010167570517\r\n#> current iteration: 17\r\n#> current error: 0.00145499388634334\r\n#> current iteration: 18\r\n#> current error: 0.00123546459162101\r\n#> current iteration: 19\r\n#> current error: 0.00105786936190601\r\npc_df = pc_df %>%\r\n  mutate(psi1_est = bfpca_object$efunctions[,1],\r\n         psi2_est = bfpca_object$efunctions[,2],\r\n         alpha_est = bfpca_object$alpha)\r\nggplot(pc_df, aes(index, pop_mean)) + theme_bw() + geom_line(color = \"blue\") +\r\n  geom_line(aes(y = alpha_est), linetype = 2, color = \"red\")\r\n#> Error: Column `y` must be a 1d atomic vector or a list\r\n```\r\n\r\n![](https://i.imgur.com/2fwH6K9.png)\r\n\r\nThe object `bfpca_object$alpha` is a 200-by-1 matrix, consistent with the `bfpca` tests, so using `alpha_est = as.vector(bfpca_object$alpha)` resolved it for me; i'm not sure if other functionality might be affected, but the vignette runs fine otherwise!"}}
{"actor":{"display_login":"julia-wrobel"}}