We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
While I was working on more tests, I saw an odd behavior that seems to be a bug
> df <- data.frame(a=c("", 1, 1), b=1:3, c=c("", "", 2)) > pander(df) ----------- a b c --- --- --- 1 1 2 1 3 2 ----------- > pander(df, emprashize.cols = 1, emphasize.rows = c(1,2)) ----------- a b c --- --- --- *2* *1* *1* 1 3 2 -----------
I added it to not forget to have a look at it later
The text was updated successfully, but these errors were encountered:
After a bit more investigation it turns out that the problem is this line.
Problem is that apply for rows returns a transposed data.frame which can't be assigned back. For example,
apply
data.frame
> df <- data.frame(a=1:3, b=1:3, c=1:3) > apply(df[c(1,2),,drop=F], c(1), identity) 1 2 a 1 2 b 1 2 c 1 2 > df[c(1,2),] <- apply(df[c(1,2),,drop=F], c(1), identity) > df a b c 1 1 1 2 2 1 2 2 3 3 3 3
Looking at documentation for apply, it seems to be consistent
If each call to FUN returns a vector of length n, then apply returns an array of dimension c(n, dim(X)[MARGIN]) if n > 1.
So it seems that when apply is only used for rows it should be transposed before assigning back
@daroczig , what do you think?
Sorry, something went wrong.
Merge pull request #177 from RomanTsegelskyi/emp_fix
8d44b2e
Fix for emphasize.rows issue #176
No branches or pull requests
While I was working on more tests, I saw an odd behavior that seems to be a bug
I added it to not forget to have a look at it later
The text was updated successfully, but these errors were encountered: