LabraMabra / M2019_4135

Data Processing and Visualization with R
3 stars 2 forks source link

Terekhova_Marina_HWs #12

Open faramer86 opened 5 years ago

faramer86 commented 5 years ago

HW_02

I have only this:

1) Variable and function names. If it is variable - what it stores? If it is function - what it does? If it is class - what is it (нем: was ist das)? Use something meaningful. x,y,z? You can batter!

2) In truth, this is it. Good job!

Nicely done! Just remember first issue :)

faramer86 commented 4 years ago

HW_03

Let it be OK. But why do you use as.dataframe her:

as.data.frame(dataset[row,col])

If there is at least 2 columns in your df, it will be dataframe. And your code always require group column. If I'm wrong, tell me)

HW_04

1) You did't define variable 'weather'.

2) Check column PrecipitationIn. What is "T"?

3) Check str(weather2). What is the problem? What data type is prevalent? Is it the right way to store it like so?

All in all, nice job! Fix it and I'm OK with HW_04.

teresho4 commented 4 years ago

HW_03

Actually, I can't explain why I use exactly as.data.frame to make subset, but yes, if there will be 1 column it will be an error. But! if you try this code outside of function: as.data.frame(mtcars[c(1,2,3,4,10),2]) it will work :) It is very strange to use only one column in this code because we are making split by some parameter and so on. But I get the point that we should use some construction like these: newdataset <- mtcars[c(1,2,3,4,10,11,12,13,21,22,23,24),c(2,3)]

HW_04 checked and updated!

teresho4 commented 4 years ago

HW_05 is uploaded!

faramer86 commented 4 years ago

HW_03

I'm OK with your solution.

HW_04

Great. Thanks for googling "Trace" :)

teresho4 commented 4 years ago

Uploaded HW 6 for visualizing data (part 1 and 2) and HW 7 (Shiny App)

faramer86 commented 4 years ago

HW_05

I'm OK with your solution.

Notes: 1) c(1,2,3,4) -> 1:4 2) c(10,11,12,13,21,22,23,24,25) -> c(10:13, 21:25)

HW_06

Part A: Great. That is exactly what I want to see. Notes:

1) "good" style:

iris_long <- iris %>%
      mutate(row = row_number()) %>%
      gather(key = "attributes", value = "values", Sepal.Length:Petal.Width) %>%
      separate(attributes, into = c("Part", "mesuare"))  %>%
      spread(mesuare, values) %>%
      select(-row)

"not so good" style:

iris_long <- iris %>% mutate(row = row_number()) %>% gather(key = "attributes", value = "values", Sepal.Length:Petal.Width) %>% 
  separate(attributes, into = c("Part", "mesuare"))  %>% spread(mesuare, values) %>%  select(-row)

2) Also you can use gather(attributes, values, -Species) instead gather(attributes, values, Sepal.Length:Petal.Width)

Part B: It is exactly the task. Reproduce plots from the slides.

Issues:

1) Scatter plot. Look at the y axis and compare with reference. Hint: ylim 2) Population for 2007 year. Look at X axis and compare with reference. Hint: scale_x...

HW_APP

Excellent.

teresho4 commented 4 years ago

Thank you for the notice!

Issues solved, task updated!

faramer86 commented 4 years ago

HW_06

Issues:

> airq <- gather(airquality, Measure, Value, Ozone:Temp )
Error in is_string(x) : object 'Ozone' not found

Delete all the variables from global environment and try to relaunch your code.

teresho4 commented 4 years ago

Code relaunched

faramer86 commented 4 years ago

HW_06

Cool, I'm OK with your solution)

P.S. All is done, congrats! Wish you good luck with your project :)