Hi, I'm new to using RStudio(have some previous experience with Java) and using it for a statistics class. I've imported a .csv file and I want to add columns for a dummy variable of Smoking(Yes or No) and Diabetes(Type 1, Type 2, or No) but am having difficulty doing so. Pasted below is the code I have so far:
data(HealthData) #making sure access is possible??
View(HealthData)
dim(HealthData) #testing this function in console
summary(HealthData$Age) #test 2 of functions...
HealthData$Smoking_dummyvar=ifelse(HealthData$Smoking=='Yes',1,0)
As you can see, I did try to make a new column, but when I try to use the name() function, the column isn't shown for some reason?