Assignment 4: part e- convert to strings

Assignment 4: part e- convert to strings

by Noor AL Kaabi -
Number of replies: 3

Hi! i'm trying to figure out how to convert '09' to 'september' using the as.character function, I used September <- as.character(myfile$09), but it's not working- i'm not sure if i'm using the function right?

(in this case, myfile is the dataframe I used early on to read the data)

In reply to Noor AL Kaabi

Re: Assignment 4: part e- convert to strings

by Cong Lu -
I don't know how to do it, but I think there is no need to convert '09' to 'September' in this part.
In reply to Noor AL Kaabi

Re: Assignment 4: part e- convert to strings

by Erik Spence -
Do you have a column named "09"? If not, why are you trying to reference it using myfile$09?

The dates are already characters. But nonetheless, it doesn't matter whether they're number or strings, as long as you treat them appropriately for what they are.
In reply to Noor AL Kaabi

Re: Assignment 4: part e- convert to strings

by Mahnoor Hamid -
in as.character(), the bracket should say dataframe$column because you are slicing your dataframe for a specific column to turn into a string. Remember a string is like beads on a thread so something like 1 2 3 4 5 is a string with 10 beads (you count the spaces, dashes, etc)