Code Monkey home page Code Monkey logo

free_r_tips's Introduction

free_r_tips's People

Contributors

mdancho84 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

free_r_tips's Issues

040_modeltime_forecasting model_prophet changed parametrization

It seems the parametrization for model_prophet has changed to:

model_prophet <- prophet_reg() %>%
set_engine("prophet",yearly.seasonality=TRUE) %>%
fit(cnt ~ dteday, training(splits))

FROM:

model_prophet <- prophet_reg(
seasonality_yearly = TRUE
) %>%
set_engine("prophet") %>%
fit(cnt ~ dteday, training(splits))

Poetry

Set up poetry and organize doc structure.

Setup poetry

Prepare the repo for poetry package-like structure.

update in free_r_tip 20 (SQL from R) required.

dplyr::across does not take a vector of c(mean, median) as a value to the .fns argument. Instead a list list(mean, median) is required.
Found this by coincidence, so other skripts might need some adaption as well.

Greetings
Felix

018 - Rayshader

There's an error when i run the script...

> # ggplot (2D visualization) - DS4B 101-R, Week 4
> g1 <- mtcars %>%
+     ggplot(aes(disp, mpg, color = cyl)) +
+     geom_point(size=2) +
+     scale_color_continuous(limits=c(0,8)) +
+     ggtitle("mtcars: Displacement vs mpg vs # of cylinders") +
+     theme(title = element_text(size=8),
+           text = element_text(size=12))
> # rayshader
> g1 %>%
+     plot_gg(
+         height        = 3,
+         width         = 3.5,
+         multicore     = TRUE,
+         pointcontract = 0.7,
+         soliddepth    = -200
+     )
Error in hillshade[, , 1] * scales::rescale(shadowmap, c(max_darken, 1)) : 
  non-conformable arrays
> g1 %>%
+     plot_gg(
+         height        = 3,
+         width         = 3.5,
+         multicore     = TRUE,
+         pointcontract = 0.7,
+         soliddepth    = -200
+     )
Error in hillshade[, , 1] * scales::rescale(shadowmap, c(max_darken, 1)) : 
  non-conformable arrays
> # 3D ELEVATION MATRIX ----
> volcano
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
 [1,]  100  100  101  101  101  101  101  100
 [2,]  101  101  102  102  102  102  102  101
 [...]
 
 > volcano %>% class()
[1] "matrix" "array" 
> # dplyr (data wrangling) - DS4B 101-R, Weeks 2&3
> volcano_tbl <- volcano %>%
+     as_tibble(.name_repair = "minimal") %>%
+     set_names(str_c("V", seq_along(names(.)))) %>%
+     rowid_to_column(var = "x") %>%
+     pivot_longer(
+         cols      = contains("V"),
+         names_to  = "y",
+         values_to = "value"
+     ) %>%
+     mutate(y = str_remove(y, "^V") %>% as.numeric())
> # ggplot (visualization) - DS4B 101-R, Week 4
> g2 <- volcano_tbl %>%
+     ggplot(aes(x = x, y = y, fill = value)) +
+     geom_tile() +
+     geom_contour(aes(z = value), color = "black") +
+     scale_x_continuous("X", expand = c(0,0)) +
+     scale_y_continuous("Y",expand = c(0,0)) +
+     scale_fill_gradientn("Z", colours = terrain.colors(10)) +
+     coord_fixed()
> g2 %>%
+     plot_gg(
+         multicore = TRUE,
+         raytrace = TRUE,
+         width = 7,
+         height = 4,
+         scale = 300,
+         windowsize = c(1400, 866),
+         zoom = 0.6,
+         phi = 30,
+         theta = 30
+     )
Error in hillshade[, , 1] * scales::rescale(shadowmap, c(max_darken, 1)) : 
  non-conformable arrays
In addition: Warning messages:
1: The following aesthetics were dropped during
statistical transformation: fill
ℹ This can happen when ggplot fails to infer the
  correct grouping structure in the data.
ℹ Did you forget to specify a `group` aesthetic
  or to convert a numerical variable into a
  factor? 
2: The following aesthetics were dropped during
statistical transformation: fill
ℹ This can happen when ggplot fails to infer the
  correct grouping structure in the data.
ℹ Did you forget to specify a `group` aesthetic
  or to convert a numerical variable into a
  factor? 
3: Removed 1861 rows containing missing values
(`geom_contour()`). 

I don't know where to start to look for. Thanks for the help

055_ggradar: radar plots - object 'rescale' not found

FORMAT ----

vehicle_summary_tbl <- mpg %>%
select(class, where(is_numeric), -year) %>%
group_by(class) %>%
summarise(
across(displ:hwy, .fns = median)
) %>%
ungroup() %>%
rename(group = class) %>%
mutate_at(vars(-group), rescale)

Error in is_fun_list(.funs) : object 'rescale' not found
In addition: There were 11 warnings (use warnings() to see them)

warnings()
Warning messages:
1: Deprecated
2: Deprecated
3: Deprecated
4: Deprecated
5: Deprecated
6: Deprecated
7: Deprecated
8: Deprecated
9: Deprecated
10: Deprecated
11: Deprecated

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.