Closed Andrzej-Andrzej closed 5 years ago
Hey
Could you provide the following elements?
[ ] The code that is producing the error, it has to be a minimal reproducible example.
Stackoverflow is providing good explanations about it: https://stackoverflow.com/help/mcve. You can use package reprex
to help you: http://reprex.tidyverse.org/. The most popular R stackoverflow question is about the subject: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example.
[ ] the results of R command sessionInfo()
. It had to be executed after you loaded the packages used by your example. This will let me know what is your version of R and what are the versions of the packages you used in your example.
Hi, code: print( flextable( d ), "docx" ) where d is my data.frame. 3 variables and 657 obs.
sessionInfo() R version 3.6.0 (2019-04-26) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64
Attached packages: tidyverse + flextable + baseR: datasets utils graphics grDevices stats methods base
I really need the elements requested upper. For example, I don't know what version of packages you are using. Also you can provide a sample of your data with dput(head(d))
and copy paste the result.
You will find below an example:
library(flextable)
d <- head(iris)
dput(d)
#> structure(list(Sepal.Length = c(5.1, 4.9, 4.7, 4.6, 5, 5.4),
#> Sepal.Width = c(3.5, 3, 3.2, 3.1, 3.6, 3.9), Petal.Length = c(1.4,
#> 1.4, 1.3, 1.5, 1.4, 1.7), Petal.Width = c(0.2, 0.2, 0.2,
#> 0.2, 0.2, 0.4), Species = structure(c(1L, 1L, 1L, 1L, 1L,
#> 1L), .Label = c("setosa", "versicolor", "virginica"), class = "factor")), row.names = c(NA,
#> 6L), class = "data.frame")
print( flextable( head(iris) ), "docx" )
#> a flextable object.
#> col_keys: `Sepal.Length`, `Sepal.Width`, `Petal.Length`, `Petal.Width`, `Species`
#> header has 1 row(s)
#> body has 6 row(s)
#> original dataset sample:
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> 1 5.1 3.5 1.4 0.2 setosa
#> 2 4.9 3.0 1.4 0.2 setosa
#> 3 4.7 3.2 1.3 0.2 setosa
#> 4 4.6 3.1 1.5 0.2 setosa
#> 5 5.0 3.6 1.4 0.2 setosa
Created on 2019-07-19 by the reprex package (v0.3.0)
Hi, closing that issue as I can not reproduce it. I will reopen it if I am able to reproduce
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.
Hi, I receive this message whenever I work with flextable. Is it a way to explain or solve it ?