Find next 2 rows with same value and paste rows into new columns behind...
This is the first time I am posting a question here, so please be gentle :) I have a data frame with goal and corner statistics from the English football/soccer league (Premier League) with one game...
View ArticleGet combinations of two elements in R
I need to find all combinations between two factors with two levelsSex: Male-Female Race: White-NonwhiteI want my output to be: Male-White Female-White Male-Nonwhite Female-Nonwhite
View ArticleSales prediction and effect size regressors with Prophet or Lineair Regression
I am using Prophet and Linear Regression in order to:Predict sales on day level / store level;Understand the effect size of my repressors (x variables).I don’t necessarily want to stick to these...
View ArticleUnderstanding how `levelplot` is done in R
On the example given below, which can easily be done using the levelplot function of R, I would like to ask a question of interpretation: if, for example, I have several values with drat on the x axis,...
View ArticleHow do I push data from a RStudio data frame to MSSQL server table (new)
I have set up DB server in my local system and tried pushing data in a new table but unable to push data, I have connected MS SQL server using DSN i.e. "VB"con <- dbConnect(odbc::odbc(), "VB") Tried...
View ArticleScraping html table and its href Links in R when there are more than one...
My question is actually the same as the one asked here : Scraping html table and its href Links in RBut the solution provided does not work in my case...or there is something I didn't understand... In...
View ArticleWhy is a keras neural network model with one output neuron so much better...
Using the code below I train two networks. Both networks are identical but the second network (model2) has two output neurons. The target output for the first network (model1) is the sale price of some...
View ArticleHow to calculate the elder generation’ maximum education year in one family
Suppose I have dataframe like this: family relationship meanings edu 1 1 A respondent 12 2 1 B respondent's spouse 18 3 1 C A's father 10 4 1 D A's mother 9 5 1 E1 A's first son 15 6 1 F1 E1's spouse...
View Articleperforming all possible linear regressions between 1 variable and a list of...
I am using the following code ( which was developed in a previous post) for the following task: performing all possible linear regressions between the first variable and the other variables and saving...
View ArticleHow to filter a very large csv in R prior to opening it?
I'm currently trying to open a 48GB csv on my computer. Needless to say that my RAM does no support such a huge file, so I'm trying to filter it before opening. From what I've researched, the most...
View Articler Are there any changes I can make to speed up my parallelized code that...
The code below is a parallel version of a some code I had written earlier. Both versions do what they are supposed to. Both versions take about 5.7 minutes to complete. Constructing a reproducible...
View ArticleHow to use a non-default colorscale in R plotly chloropleth maps?
I'm creating a chloropleth map in R using plotly, and the only trouble I'm having is setting a different colorscale. I would like to use the magma colorscale from the viridis package, but I can't seem...
View ArticleCreate dataframe of all combinations of a list
I have dataframe of integers from 1 to 900. nodelist <- data.frame(node_id=seq(1:900)) I want to create a new dataframe of two columns (top, bottom) that has each combination of the vector nodelist....
View ArticleFinding source code of R packages and potentially making changes
I would like to find and read the source code of an R package. Let's say I would like to find purrr and figure out the difference between map_chr() and find out if it is using lapply().purrr directory...
View ArticleTrying to write an R function: is it the For Loop or the numeric vector that...
I have a function like this (see below) and I genuinely cannot understand why it doesn't work.The for loop itself, when run separately (not inside of a function) does work perfectly but the function...
View ArticleHow to install "Hmisc" in R
install.packages("Hmisc") Warning in install.packages : unable to access index for repository https://cran.rstudio.com/src/contrib: cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'...
View ArticleR cannot find a conda function: Error in instalation of ee_grab
I follow the directions of https://github.com/JesJehle/earthEngineGrabR and try to install ee_grab.However, I always get the following message:Error: Installation problem Error: Error 1 occurred...
View ArticleR html_nodes() function giving error Unexpected character '$'
I am trying to extract financial data from Yahoo Finance. When I am running, it is giving error"Error in tokenize(css) : Unexpected character '$' found at position 19"urlYCashflow <-...
View ArticleDcast in R basis repeated
I have data named as my_data. The amount of data is > 100000. Sample output is like belowid source 8166923397733625478 happimobiles 8166923397733625478 Springfit 7301100145962413274 Duroflex...
View ArticleNumber within r being wrongly recognized
I have a row of data that is created through ifelse statement of proper data. mutate(yrsatrisk = ifelse(!is.na(Age_at_death), as.numeric(Age_at_death), ifelse(!is.na(Age_at_last_update),...
View Article