Евгения-Лиза Шелюхина
2014-Nov-18 21:33 UTC
[R] R 3.1.2 (x64) Programming Assignment 1: Air Pollution(corr) do not understand the task
Dear R experts, I've submited correctly "pollutionmean" and "complete" tasks, but "corr" returns error, despite the beginning of the result is the same as example output. (screenshot attached) May be I understood the task wrongly; file of my function is attached, and it does following: 1) sets directory 2) puts all files from the directory into one dataframe 3) removes NA values 4) creates zero vector "cr" 5) does the cycle: for each monitor location (id) counts number of cases "nmb" If "nmb" is more than threshold, calculates cor() puts cor() result into numeric vector "cr" 6) prints result as numeric vector I have tried to change cor() function to the complex one with "method" etc, tried to change "complete.cases" conditions, cycle structure, but it doesn't help. I think the reason is I understand task wrongly.... Please, tell me where Im wrong. Thank you, Eva Best Regards, Evgeniia-Liza Sheliukhina
David Winsemius
2014-Nov-18 23:25 UTC
[R] R 3.1.2 (x64) Programming Assignment 1: Air Pollution(corr) do not understand the task
This is not the help forum for Coursera classes. -- David. On Nov 18, 2014, at 1:33 PM, ???????-???? ???????? wrote:> Dear R experts, > > I've submited correctly "pollutionmean" and "complete" tasks, but "corr" > returns error, despite the beginning of the result is the same as example > output. (screenshot attached) > > May be I understood the task wrongly; file of my function is attached, and > it does following: > 1) sets directory > 2) puts all files from the directory into one dataframe > 3) removes NA values > 4) creates zero vector "cr" > 5) does the cycle: > for each monitor location (id) counts number of cases "nmb" > If "nmb" is more than threshold, calculates cor() > puts cor() result into numeric vector "cr" > 6) prints result as numeric vector > > I have tried to change cor() function to the complex one with "method" etc, > tried to change "complete.cases" conditions, cycle structure, but it > doesn't help. > I think the reason is I understand task wrongly.... > Please, tell me where Im wrong. > > Thank you, > Eva > > Best Regards, > Evgeniia-Liza Sheliukhina > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.David Winsemius Alameda, CA, USA
Aditya Singh
2014-Nov-19 03:35 UTC
[R] R 3.1.2 (x64) Programming Assignment 1: Air Pollution(corr) do not understand the task
Eva and Professor Peng, I spent many hours on Programming Assignment 1, however I was unable to get it right. I found it most useful and think others should work at it too! Please do send me your work now that the deadline is over. Or you could tell me your Github account so that I could fork it? I will send you my work if you want! Thanking you in advance, Dr. Aditya P. Singh 8133/5 Stadium Road, Patiala 147001 India. On Wednesday, November 19, 2014 4:52 AM, ???????-???? ???????? <evlizashel at gmail.com> wrote: Dear R experts, I've submited correctly "pollutionmean" and "complete" tasks, but "corr" returns error, despite the beginning of the result is the same as example output. (screenshot attached) May be I understood the task wrongly; file of my function is attached, and it does following: 1) sets directory 2) puts all files from the directory into one dataframe 3) removes NA values 4) creates zero vector "cr" 5) does the cycle: for each monitor location (id) counts number of cases "nmb" If "nmb" is more than threshold, calculates cor() puts cor() result into numeric vector "cr" 6) prints result as numeric vector I have tried to change cor() function to the complex one with "method" etc, tried to change "complete.cases" conditions, cycle structure, but it doesn't help. I think the reason is I understand task wrongly.... Please, tell me where Im wrong. Thank you, Eva Best Regards, Evgeniia-Liza Sheliukhina ______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.