print(grade)
grade
marklist names grade
1 98 A A
2 74 B D
3 32 C F
4 58 D D
5 64 E D
6 98 F A
7 85 G B+
8 51 H D
my question is how I can write B plus superscript as a character " B +" plus sign should be superscript.
Error: Problem with mutate() input grade.
x false must be an expression vector, not a character vector.
i Input grade is if_else(...).
it is not valid for character
if_else(marklist>=50, expression("D"),expression("F"))))))
Error: Problem with mutate() input grade.
x Input grade must be a vector, not an expression vector.
i Input grade is if_else(...).
Run rlang::last_error() to see where the error occurred.
print(grade_df)
marklist names grade
1 32 C F
2 51 H D
3 58 D D
4 64 E D
5 74 B D
6 85 G "B"^"+"
7 98 A A
8 98 F A
it does not work for data frame or table, for a plot it works, my question is how we can write superscript and subscript in a table, data-frame.
You should not expect it to work in a data.frame.
It is purely representational therefore when it is time to publish/print a nice table for presentation you would pick one of the many table printing packages... gt, flextable,datatable, huxtable, etc etc.