I am currently trying to produce a scatterplot of a .txt file that is structured like this in 25 rows:
age income weight
33 63 180
25 72 220
however, when I try to convert it to a csv and then produce a scatterplot with the following code:
my_input <- read.csv2('dataInput.txt', sep = '\t', header = T)
plot(x = my_input$ageX, y = my_input$weightY)
I get an error message. I also notice that there is now a period between 'age' 'income' and 'weight', which I don't understand since I would expect to get a comma between them. the error message is as follows:
Error in plot.window(...) : need finite 'xlim' values In addition: Warning messages: 1: In min(x) : no non-missing arguments to min; returning Inf 2: In max(x) : no non-missing arguments to max; returning -Inf 3: In min(x) : no non-missing arguments to min; returning Inf 4: In max(x) : no non-missing arguments to max; returning -Inf
Any ideas on how to actually get a scatterplot of the data?
Edit: executing
head(my_input)
age. income. weight
1 56 63 185
2 38 72 156
3 28 75 178
4 49 59 205
5 69 65 235
6 19 70 195
Edit:
str(my_input)
age.income.weight: Factor w/ 18 levels "56 63 185",..: 1 2 3 4 5 6 7 8 9 10 ...
summary(my_input)
age.income.weight
56 63 185: 1
38 72 156: 1
28 75 178: 1
49 59 205: 1
69 65 235: 1
19 70 195: 1
(Other) :19
str(my_input)
– dc37