Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help with a HW assigment in R code. write an R code to read the file and calculate the mean of heights. Remember
I need help with a HW assigment in R code. write an R code to read the file and calculate the mean of heights. Remember to remove those entries with no height entered.
below is data from an excel file. Please Help.
sex | height | weight | handedness | exercise | smoke |
Female | 68 | 158 | Right | Some | Never |
Male | 70 | 256 | Left | None | Regul |
Male | NA | 204 | Right | None | Occas |
Male | 63 | 187 | Right | None | Never |
Male | 65 | 168 | Right | Some | Never |
Female | 68 | 172 | Right | Some | Never |
Male | 72 | 160 | Right | Freq | Never |
Female | 62 | 116 | Right | Freq | Never |
Male | 69 | 262 | Right | Some | Never |
Male | 66 | 189 | Right | Some | Never |
Female | 62 | 145 | Right | Freq | Never |
Male | NA | 210 | Right | Freq | Never |
Female | 61 | 169 | Right | Some | Never |
Female | 61 | 142 | Right | Some | Never |
Male | NA | 152 | Right | Some | Never |
Female | 61 | 144 | Right | Freq | Never |
Female | 62 | 130 | Right | Freq | Never |
Male | 72 | 179 | Left | Some | Never |
Male | 75 | 226 | Right | Some | Never |
Male | 70 | 193 | Right | Freq | Never |
Male | 75 | 182 | Right | Freq | Never |
Male | 71 | 149 | Right | Freq | Never |
Male | 71 | 180 | Right | Freq | Never |
Male | 72 | 204 | Right | Some | Never |
Female | NA | 132 | Right | Some | Never |
Male | NA | 242 | Right | Some | Never |
Male | 68 | 208 | Right | Some | Never |
Male | 69 | 171 | Right | Freq | Never |
Male | NA | 137 | Right | Freq | Never |
Male | 66 | 215 | Right | Some | Never |
Female | NA | 152 | Right | None | Occas |
Male | 71 | 211 | Right | Freq | Never |
Female | 66 | 136 | Right | Freq | Heavy |
Male | 71 | 232 | Right | Some | Never |
Male | NA | 260 | Right | Some | Regul |
Male | 75 | 179 | Right | Freq | Occas |
Female | 66 | 172 | Right | Some | Never |
Male | 72 | 218 | Right | Freq | Never |
Male | 73 | 213 | Right | Some | Never |
Male | 67 | 191 | Right | Freq | Occas |
Female | 66 | 137 | Right | Some | Never |
Female | 61 | 161 | Right | Some | Never |
Male | 68 | 189 | Right | Some | Never |
Female | 70 | 138 | Right | Some | Never |
Female | 71 | 172 | NA | Freq | Never |
Male | 71 | 228 | Right | Freq | Never |
Male | 71 | 215 | Right | Freq | Regul |
Male | 67 | 148 | Right | None | Never |
Female | 66 | 162 | Right | Some | Occas |
Female | 65 | 183 | Right | None | Never |
Male | 79 | 173 | Left | Freq | Never |
Male | 75 | 224 | Right | Freq | Never |
Male | 67 | 204 | Right | Some | Never |
Male | 70 | 195 | Right | Freq | Never |
Male | 72 | 181 | Right | Freq | Regul |
Male | 67 | 157 | Right | Freq | Never |
Female | 62 | 197 | Right | None | Never |
Male | NA | 195 | Right | Freq | Never |
Male | 70 | 194 | Right | Freq | Never |
Male | 69 | 186 | Left | Freq | Occas |
Male | 74 | 167 | Right | Freq | Never |
Female | 66 | 141 | Right | Freq | Never |
Female | 70 | 122 | Right | Freq | Never |
Female | 67 | 169 | Left | None | Never |
Female | 65 | 185 | Right | Freq | Never |
Male | 72 | 197 | Right | Freq | Never |
Female | 68 | 152 | Right | Freq | Never |
Female | NA | 175 | Right | Freq | Never |
Male | 71 | 183 | Right | Some | Never |
Male | NA | 238 | Right | None | NA |
Female | 67 | 102 | Right | Freq | Never |
Male | 69 | 197 | Right | Freq | Heavy |
Female | 67 | 159 | Right | Some | Never |
Female | 66 | 141 | Right | Freq | Never |
Female | 65 | 157 | Right | Some | Never |
Female | 67 | 176 | Right | Freq | Heavy |
Female | 65 | 172 | Right | Some | Never |
Female | 65 | 151 | Right | Freq | Heavy |
Female | 65 | 155 | Right | Some | Never |
Male | 73 | 174 | Right | Freq | Never |
Male | NA | 189 | Left | Some | Never |
Male | 70 | 168 | Right | Freq | Never |
Female | NA | 105 | Right | Freq | Never |
Female | NA | 156 | Right | Some | Never |
Male | 66 | 213 | Right | Freq | Never |
Female | 66 | 156 | Right | Some | Never |
Female | 64 | 169 | Right | Some | Never |
Female | 67 | 171 | Right | Freq | Never |
Male | 70 | 186 | Right | Freq | Never |
Female | NA | 119 | Left | Some | Never |
Male | 72 | 164 | Right | Some | Never |
Female | NA | 141 | Right | Some | Never |
Female | 65 | 134 | Right | Some | Never |
Female | 66 | 166 | Right | Some | Never |
Male | 70 | 185 | Right | Freq | Heavy |
Female | NA | 159 | Right | Some | Never |
Male | 75 | 177 | Right | Freq | Regul |
Female | 66 | 150 | Right | Freq | Never |
Male | 65 | 199 | Right | Freq | Never |
Female | 69 | 82 | Right | Freq | Never |
Male | 74 | 178 | Right | Some | Never |
Male | 67 | 237 | Right | None | Never |
Female | 63 | 157 | Right | Some | Never |
Female | 69 | 131 | Right | Freq | Never |
Female | 64 | 141 | Right | Some | Heavy |
Female | 67 | 121 | Right | Some | Never |
Female | 68 | 148 | Right | Freq | Occas |
Female | NA | 178 | Right | Freq | Never |
Male | 71 | 166 | Right | Freq | Never |
Male | 71 | 240 | Right | Some | Regul |
Female | 69 | 138 | Right | Freq | Never |
Male | 75 | 165 | Right | None | Never |
Female | 67 | 129 | Right | Freq | Never |
Male | 73 | 157 | Right | Freq | Never |
Female | 64 | 98 | Right | Freq | Never |
Female | 62 | 164 | Right | None | Never |
Female | 63 | 180 | Right | Some | Never |
Male | 76 | 137 | Left | Some | Heavy |
Female | 67 | 203 | Left | Some | Never |
Male | 72 | 163 | Right | Freq | Heavy |
Male | NA | 193 | Right | Freq | Occas |
Male | 70 | 174 | Right | Freq | Occas |
Female | 68 | 157 | Right | Freq | Never |
Male | 71 | 170 | Left | Freq | Never |
Male | 69 | 199 | Right | Freq | Never |
Male | 71 | 185 | Right | Freq | Never |
Female | 68 | 103 | Right | Freq | Never |
Male | 70 | 190 | Right | Freq | Regul |
Female | 62 | 166 | Right | Freq | Never |
Female | 60 | 157 | Right | Some | Never |
Male | 74 | 166 | Right | Freq | Never |
Male | 70 | 155 | Right | Some | Never |
Female | NA | 181 | Right | Some | Never |
Female | 63 | 129 | Left | Freq | Occas |
Male | 69 | 220 | Right | Some | Never |
Male | 74 | 192 | Right | Some | Regul |
NA | 68 | 0 | Left | Freq | Never |
Male | 72 | 177 | Right | Freq | Never |
Male | 67 | 217 | Right | Freq | Never |
Female | 66 | 189 | Right | None | Never |
Female | 69 | 157 | Right | Some | Never |
Female | 65 | 136 | Right | None | Never |
Female | 68 | 159 | Right | Freq | Never |
Male | 71 | 150 | Right | Some | Never |
Female | 68 | 86 | Left | Freq | Never |
Male | 73 | 187 | Right | Some | Never |
Male | 74 | 203 | Right | Freq | Regul |
Male | 73 | 171 | Right | Freq | Never |
Female | 65 | 162 | Right | Freq | Never |
Female | 65 | 156 | Right | Freq | Never |
Male | 77 | 191 | Right | Freq | Never |
Female | 65 | 180 | Right | Freq | Never |
Female | 60 | 158 | Right | Some | Regul |
Male | 68 | 200 | Right | Freq | Never |
Male | 71 | 233 | Right | None | Never |
Male | 68 | 162 | Right | Freq | Never |
Male | NA | 191 | Right | Freq | Heavy |
Female | 66 | 126 | Right | Some | Never |
Male | 74 | 228 | Right | None | Never |
Male | 74 | 199 | Right | Freq | Regul |
Female | 66 | 177 | Right | None | Never |
Male | 66 | 170 | Left | Some | Never |
Male | 76 | 237 | Right | Some | Never |
Female | 67 | 99 | Right | Freq | Occas |
Male | 70 | 241 | Right | Some | Never |
Female | 66 | 164 | Right | Some | Never |
Female | 67 | 152 | Right | Some | Never |
Female | 63 | 157 | Right | Some | Regul |
Male | 74 | 168 | Right | Freq | Never |
Male | 71 | 210 | Right | Freq | Never |
Female | 66 | 167 | Right | Some | Never |
Male | 72 | 215 | Left | Some | Occas |
Female | NA | 134 | Right | Some | Regul |
Female | 65 | 170 | Right | Freq | Never |
Female | 62 | 151 | Right | Freq | Never |
Female | 67 | 160 | Left | Freq | Never |
Male | 68 | 189 | Right | Freq | Regul |
Female | 65 | 181 | Right | Freq | Never |
Female | NA | 184 | Right | Freq | Regul |
Female | 64 | 132 | Right | Some | Never |
Male | 68 | 186 | Right | Freq | Occas |
Female | 65 | 112 | Right | Freq | Occas |
Female | 64 | 128 | Right | Some | Never |
Male | 67 | 156 | Right | Freq | Never |
Male | 69 | 221 | Right | Some | Never |
Male | 66 | 958 | Right | Some | Never |
Female | 64 | 184 | Right | Some | Never |
Male | 65 | 198 | Right | None | Never |
Male | 68 | 183 | Right | Freq | Never |
Male | 77 | 168 | Right | Freq | Never |
Male | 70 | 221 | Right | Some | Never |
Male | 71 | 150 | Right | Some | Never |
Male | 69 | 185 | Right | None | Occas |
Female | 63 | 150 | Right | Some | Never |
Female | 62 | 159 | Right | None | Never |
Female | 65 | 160 | Right | Some | Never |
Female | 67 | 116 | Right | Freq | Never |
Male | 61 | 175 | Right | Freq | Never |
Female | 67 | 133 | Right | Some | Occas |
Female | 65 | 147 | Right | Some | Never |
Female | 66 | 154 | Right | Some | Occas |
Male | 68 | 180 | Right | Freq | Never |
Female | NA | 138 | Right | Some | Never |
Female | 63 | 176 | Right | None | Never |
Male | 70 | 242 | Right | Some | Regul |
Female | 66 | 101 | Right | Freq | Occas |
Female | 60 | 148 | Right | Some | Never |
Male | 63 | 193 | Right | Some | Never |
Male | 65 | 232 | Left | None | Never |
F | 68 | 112 | Right | Freq | Never |
F | 63 | 121 | Right | Some | Never |
F | 64 | 108 | Left | Some | Never |
M | NA | 178 | Right | Freq | Never |
M | 65 | 197 | Right | Some | Never |
Female | 66 | 192 | Right | Some | Never |
Male | 67 | 145 | Right | Some | Never |
Female | NA | 152 | Right | None | Never |
Male | 73 | 150 | Right | Freq | Never |
Female | 68 | 118 | Right | Freq | Never |
Male | 74 | 177 | Right | Freq | Never |
Male | 67 | 189 | Right | None | Heavy |
Female | 66 | 141 | Right | Freq | Never |
Female | 64 | 132 | Right | Some | Never |
Female | 59 | 147 | Right | Freq | Never |
Female | NA | 126 | Right | Some | Never |
Female | NA | 139 | Right | Some | Never |
Female | 67 | 178 | Right | Some | Heavy |
male | 73 | 218 | Right | Freq | Never |
female | 66 | 137 | Right | Freq | Regul |
Male | 73 | 195 | Right | Freq | Occas |
Female | 66 | 169 | Right | Some | Never |
Male | 71 | 141 | Right | Some | Never |
Female | 65 | 156 | Right | Some | Never |
Female | 63 | 159 | Right | Some | Never |
female | 67 | 152 | Right | Some | Never |
male | 72 | 193 | Right | Some | Never |
female | 66 | 178 | Right | Freq | Never |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started