0

I have some columns in a data frame with column names of CO₂.I want to change this to CO2 (no subscripts). How can I do this? in the data table, it reads as CO2 and when I print column names, it reads as CO₂.

I tried following code but it refuses to change.

enter image description here

4
  • 1
    Please share your data using dput(dataset)? Commented Jun 1, 2022 at 17:07
  • looks like duplicate question: stackoverflow.com/questions/58007087/… Commented Jun 1, 2022 at 17:12
  • 2
    @Quinten I'd strongly advise asking for dput of data subsets, not whole data. Especially on a question like this that is about the column names, we don't need or want the whole data set. dput(dataset[1:5, ]) is good--or in this case dataset appears to be a list so dput(dataset[[1]][1:5, ]). Commented Jun 1, 2022 at 17:15
  • @GregorThomas, You are completely right, my bad. Commented Jun 1, 2022 at 17:17

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.