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

createComment produced "height argument must be a numeric vector" when number is integer #538

Open
yb2125 opened this issue Oct 15, 2021 · 0 comments

Comments

@yb2125
Copy link

yb2125 commented Oct 15, 2021

Expected Behavior

When creating comments using createComment and set height, I used the following code:
writeComment(wb, "sheet1", col = 1, row = 1,
comment = createComment(comment = "test", width = num.com, height = num.hgt)

Actual Behavior

I received the error message "height argument must be a numeric vector"

Steps to Reproduce the Problem

(please attach an example xlsx file if possible)

  1. I tried to replace num.hgt with a specific number (e.g., 5) and it worked

  2. I tried to convert num.hgt from integer to numeric with following code and it worked
    writeComment(wb, "sheet1", col = 1, row = 1,
    comment = createComment(comment = "test", width = num.com, height = as.numeric(num.hgt))

sessionInfo()

  • Version of openxlsx: 4.2.4
  • Version of R: 4.0.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant