r/learnR • • Jun 05 '20

Free course to learn R for beginners

15 Upvotes

I'm learning R myself and I just found a free course that teaches you in R or RStudios. It's a package called swirl. For those who don't know what that means, here's how to start the course:

install.packages("swirl")

library(swirl)

swirl()

--------------------------------------------------

run each line of code after you type it in (in RStudio, Ctrl+ENTER runs the current line of code you're on)


r/learnR • • Oct 05 '20

Study group for Introduction to Statistical Learning (with R) by Gareth James

9 Upvotes

Introduction to Statistical Learning (with applications in R) by Gareth James

Study group Discord link: https://discord.gg/6qZxuHk


r/learnR • • Aug 03 '21

Learn R study buddy

7 Upvotes

Hi there, my name is Skyler, (GMT+2), university student studying to become a data analyst, looking for a study buddy to learn R with I’m currently, reading a modern dive into R and tidyverse and will follow up with R is for data science if your interested in teaming up via discord feel free to send me a private message.


r/learnR • • May 15 '21

Help finding resources to answer part C of the question please ?

Thumbnail
gallery
6 Upvotes

r/learnR • • Mar 10 '21

Resource recommendation for learning R

6 Upvotes

Hi everyone, I work for a statistical non-profit called Statistics for Sustainable Development (Stats4SD) and as part of recent work we have started creating videos to help teach people a bit more about R. In particular some aspects of the tidyverse range of packages (Link to tidyverse - https://www.tidyverse.org/)

The video linked here was the first of 3 videos on learning how to create graphs with ggplot2 instead of the base plotting packages. You can find the rest of the videos as well as others on dplyr and statistical modelling on our channel as well.

Hopefully this well help some people learn to easily create much nicer looking graphics than what base R can offer.”


r/learnR • • Mar 25 '20

Find a course buddy during quarantine!

5 Upvotes

Hi! One of the best things you can do during quarantine is learning a new framework, programming language or something entirely different.

But doing these courses feels kinda lonely and often you just stop doing them so I thought I’d create a site where you can find buddies to do the same course with (frankly this quarantine is becoming really boring).

The idea is that you talk regularly about your progress and problems you're facing so you can learn and grow together.

If you’re interested, take a look at Cuddy and sign up for the newsletter!

If enough people sign up I’ll be happy to implement the whole thing this week.

Also if you've got questions or feature ideas please do let me know in the comments! :)

Let's destroy this virus together and take it as an opportunity to get better at what we love!


r/learnR • • Apr 11 '19

Best websites/tools to learn R?

5 Upvotes

This might be a duplicate question but I was looking for any datasets/websites to help me develop R, I have basic knowledge but I want to see how I can apply the language


r/learnR • • Aug 21 '23

Accountability & Studdy Buddy for Statistician with R

4 Upvotes

Hi, people of r/learnR!

I've been meaning to work on Statistician with R through DataCamp at a consistent pace, but life and demotivation have really been getting in the way. I figured that having an accountability buddy might be a way to remedy that!

We can do things like let each other know of periodical goals, and then update each other if we've achieved them. We can also be sounding boards for each other for reflections and questions we might have :)

If anyone's interested, please feel free to comment!

PS: In case you'd prefer working with someone from a specific background, I'm a sophomore undergraduate student in a research-focused program :)


r/learnR • • Jan 19 '22

Using r how to match elements in a data frame and make a list of the corresponding row's first entry?

4 Upvotes

Hello everyone,

I am trying to sort the data frame as given below. The entries below are numeric but an actual dataset may be alphanumeric and the values in column 1 may not be unique either. Please help.


r/learnR • • Aug 24 '20

R Resources Organized - Beginner R Tutorials

4 Upvotes

This post was deleted using Redact. The deletion may have been privacy-motivated, security-driven, opsec-related, or simply a personal decision by the author.

truck towering fear north rhythm modern plate hospital money theory


r/learnR • • Aug 23 '20

Data manipulation in r using data frames - an extensive article of basics

4 Upvotes

Learn data manipulation in R using base and dplyr functions in this extensive article using financial data. Learn how to subset data frame rows, data frame columns, transform the data frame by adding a new column, removing new column and renaming columns.

Learn how to merge two data frames in R using different types of join. Here is the overview of the article:

  1. Data

  2. Reading Data

  3. Subset data by

    1. row numbers or index

    2. using operators

    3. specifying logical conditions

    4. specifying logical conditions using dplyr function 

    5. using subset function

  4. Transform by

    1. adding a new column to the data frame

    2. removing a column from the data frame

    3. renaming column of a data frame

    4. renaming multiple variables of a data frame

    5. merging and uniting data frames


r/learnR • • Jul 28 '20

Trying to use the count function on each numeric column of a data frame. Not sure why this doesn't work. . .

4 Upvotes
library(tidyverse)
map(iris[map_lgl(iris, is.numeric)], count)

 

Error in UseMethod("tbl_vars") : no applicable method for 'tbl_vars' applied to an object of class "c('double', 'numeric')"

I just want to apply the count() function to every numeric column in the iris data frame. I know I've done something like this before, I just can't figure out why this doesn't work. It does work with sum, which makes this more puzzling.

Edit: Kudos to /u/unclognition for pointing me in the right direction. The following is the solution.

map(iris, count, x = iris)

The issue was that the count function needs the data frame as the first argument. Map however would only pass the column as an argument. As a result, providing the x = iris as another parameter to map allows that to be passed to the count function and then the column is treated appropriately. The result is a frequency of all the values in the column with the associated counts.


r/learnR • • Feb 26 '19

Is this the only subreddit to learn R?

4 Upvotes

I saw the python group had several hundred thousand followers but we have a couple hundred. Is there a bigger group around here?

I saw /programming and /programming learning but both of those seem to be all languages. I’m interested in R only.

Thanks for your help!


r/learnR • • Mar 31 '23

[OC] Just learned how to make animated charts like the one below, showing the relation between the "Deutsche Bank" narrative, and the Bitcoin price. The Deutsche line is based on 1,200,000 financial news articles, and shows how widespread the narrative is. Wuhuu. Love R.

3 Upvotes

r/learnR • • Oct 04 '22

Happy Cakeday, r/learnR! Today you're 11

3 Upvotes

r/learnR • • Sep 06 '22

Need help with adding returns in R

3 Upvotes

Hi everyone! I need help adding 30 stock returns. I already have a list with variables for the returns calculated, but was unsure how to actually how to add them. I feel like there would be a way for me to write a for loop to make it more efficient, but any guidance would be greatly appreciated. Thank you!


r/learnR • • Aug 08 '22

Help please: how to format/wrangle a csv dataset

3 Upvotes

Hello beautiful redditors. I need help with some data wrangling please.

I have the following dataset:

Its about gas storage in the Netherlands.

What we need is only the 'gasDayStart' and 'gas in Storage'. We would like to visualize how the gas in storage changes per month for the past 4 years. So we would ideally create another dataset with the following columns: Gas Day Start (the 1st of every month); 2019 (how much gas there is on that day in that year); 2020; 2021; 2022. It would look like:

Can someone offer some help in what I would do with the dataset to achieve that?

Thanks in advance!


r/learnR • • Dec 06 '21

Daily Web Scraping Code - HELP!

3 Upvotes

Does anyone have a code for web-scraping and to graph the prices daily?

I'm trying to do it but I have no idea how to start. Any support I will appreciate it!

EDIT: My code is in the comments.


r/learnR • • Oct 04 '21

Happy Cakeday, r/learnR! Today you're 10

3 Upvotes

r/learnR • • Jul 30 '21

Learning R

3 Upvotes

Hi! So I've been spending time going through books like R for Data Science and courses, and I think I get it and I can follow along and do it myself. So then I decided to find my own dataset and now when I have nothing to sort of guide me I feel so lost? Am I doing something wrong in this approach? I make so many errors and the skills I thought I had, I seem to struggle with now..


r/learnR • • Jul 27 '21

learn R

3 Upvotes

hi! I am new here and to learning coding but I would like to learn R for finance. any tips/resources/books/videos/courses anyone recommends?

I am an absolute beginner into coding currently trying to get through the R for Data Science book to just learn some more R(its been challenging). I would appreciate any tips and advice thank you!!


r/learnR • • Dec 16 '20

Simulate unbalanced clustered data

3 Upvotes

I want to simulate some unbalanced clustered data. The number of clusters is 20 and the average number of observations is 30. However, I would like to create an unbalanced clustered data per cluster where there are 10% more observations than specified (i.e., 33 rather than 30). I then want to randomly exclude an appropriate number of observations (i.e., 60) to arrive at the specified average number of observations per cluster (i.e., 30). The probability of excluding an observation within each cluster was not uniform (i.e., some clusters had no cases removed and others had more excluded). Therefore in the end I still have 600 observations in total. Anyone knows how to realize that in R? Here is a smaller example dataset. The number of observation per cluster doesn't follow the condition specified above though, I just used this to convey my idea.

y <- rnorm(20)
x <- rnorm(20)
z <- rep(1:5, 4)
w <- rep(1:4, each=5)
data.frame(id=z,cluster=w,x=x,y=y) #this is a balanced dataset
   id   cluster      x           y
1   1       1  0.89525254 -0.65850860
2   2       1 -0.02805877 -1.82631350
3   3       1 -0.99974702 -0.41860392
4   4       1 -0.15960396 -0.36620401
5   1       2 -0.52769365 -0.29400111
6   2       2  0.21615646 -0.02312263
7   3       2 -0.91895498  0.36239938
8   4       2 -0.90059465 -0.46671438
9   1       3  0.28860879  0.29851361
10  2       3  0.92888479 -0.95270815
11  3       3  1.67304721  0.66754058
12  4       3  0.28551442  0.08723854
13  1       4 -0.37258244 -0.10920945
14  2       4 -1.43388276 -0.67749220
15  3       4 -0.88446792  1.69882266
16  4       4  1.12418294  0.38583100
17  1       5 -0.72280580  0.24675703
18  2       5  0.46266496 -2.58693176
19  3       5 -0.31255353 -1.96310302
20  4       5  0.84825450 -0.06130483

After randomly adding and deleting some data, the unbalanced data become like this:

            id   cluster   x     y
       1     1       1  0.895 -0.659 
       2     2       1 -0.160 -0.366 
       3     1       2 -0.528 -0.294 
       4     2       2 -0.919  0.362 
       5     3       2 -0.901 -0.467 
       6     1       3  0.275  0.134 
       7     2       3  0.423  0.534 
       8     3       3  0.929 -0.953 
       9     4       3  1.67   0.668 
      10     5       3  0.286  0.0872
      11     1       4 -0.373 -0.109 
      12     2       4  0.289  0.299 
      13     3       4 -1.43  -0.677 
      14     4       4 -0.884  1.70  
      15     5       4  1.12   0.386 
      16     1       5 -0.723  0.247 
      17     2       5  0.463 -2.59  
      18     3       5  0.234  0.893 
      19     4       5 -0.313 -1.96  
      20     5       5  0.848 -0.0613

r/learnR • • Jul 04 '19

Help with a code....

3 Upvotes

beginner here. doing an online tutorial that does not have answers.

Q: Make a vector from 1 to 100. Make a for-loop which runs through the whole vector. Multiply the elements which are smaller than 5 and larger than 90 with 10 and the other elements with 0.1.

my code:

h=seq(from=1,to=100,by=1) g=c() for(i in 1:100) { if(h[i]<5&h[i]>90) {g[i]=h[i]*10 }else{ g[i]=h[i]*0.1} } print(g)

I am getting hananswer where everything is multiplied by 0.1

ans:

[1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 [17] 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3.0 3.1 3.2 [33] 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 [49] 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6.0 6.1 6.2 6.3 6.4 [65] 6.5 6.6 6.7 6.8 6.9 7.0 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8.0 [81] 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9.0 9.1 9.2 9.3 9.4 9.5 9.6 [97] 9.7 9.8 9.9 10.0

How do I fix this? Thank you.


r/learnR • • Apr 23 '19

Curl or other places to do API?

3 Upvotes

Is anyone familiar with the package curl or RCurl?

Are there any solid primers I could read? I'm having a hard trouble just trying to get stuff to run or what to look at when getting code to run?

Thanks


r/learnR • • Apr 06 '18

Itterating over collumns in a dataframe

3 Upvotes

In preparation for a data analysis thesis I am trying to teach myself some R by doing some small projects. At the moment I am trying to make summaries (for now) of each column in a data frame looking like this: column1: response dates column2: names column3-24: availability (either NO, or 1-3 choice) per date. (for example 1st of Jan, 5th of Jan, 1st of Feb, 20th of Feb etc..)

Now col_summary<-

  •    MyFile      %>%
  •    group_by(`1st of Jan`)%>%
  •    summarise(name_count=n())

gives my a perfect summary of the assurances of each response in the column. However so far I have not been able to iterate over the columns. Do you have a solution, or know a place I could find a tutorial on this?

Current code: for (i in MyFile) { col_summary<-

  •    MyFile      %>%
  •    group_by(`i`)%>%
  •    summarise(name_count=n())

col_summary