R curl::has_internet() FALSE even though there are internet connection
My problem arose when downloading data from EuroSTAT using the R package eurostat:# Population data by NUTS3 pop_data <- subset(eurostat::get_eurostat("demo_r_pjangrp3", time_format = "num"), (age...
View ArticleHow to group by multiple values in a function with dplyr
I wonder how to modify below codexxx<-function(df,groupbys){ groupbys<-enquo(groupbys) df%>%group_by_(groupbys)%>%summarise(count=n()) } zzz<-xxx(iris,Species) to have the option to feed...
View ArticleEquivalent of a while-loop with purrr::map
I build a webscraper function and want to scrape over multiple pages. Since I only want data in a specific period and the scraping process needs some effort since the site can become quit slow...
View ArticleCannot log-in to rstudio-server
I have previously successfully installed rstudio-server with brew install rstudio-server on a Mac OS X 10.11.4.Now, I am trying to login to rstudio-server 0.99.902 without success. From the client...
View Articletravis builds failing due to rstan compilation issues
My package builds on Linux are failing with the following compilation error for rstan package:lto-wrapper: fatal error: make returned 2 exit status compilation terminated. /usr/bin/ld: lto-wrapper...
View ArticleError with confusion matrix: Error: `data` and `reference` should be factors...
I have to evaluate the performance of a classification tree implemented by the function tree::tree(), and to do this I rely on confusionMatrix().My code istrain_idx <-...
View ArticleUnable to Install Plotly in R
I am trying to install plotly library in R. I tried following commands:install.packages("plotly") library(plotly) But I got an error. There is a binary version available but the source version is...
View ArticleGenerating samples within an sf MULTIPOLYGON in r
I'm trying to generate a set of sample points within a set of islands. I generate the coastline data as follows:library(osmdata) bb <- getbb(place_name= "Shetland") osm_box <- opq(bbox = bb)...
View ArticleHow to data.tree plot vertically by node
Any suggestions on how to plot a data.tree vertically by node instead of spread below the node?Current Method - data.tree child nodes are spread from left to right...Desired Method.... Group the nodes...
View ArticleIs there an R function for getting the percentage of contribution of lmer...
I fitted a random intercept model in R and I'm trying to get the percentage of contribution of each predictors on R-square. I calculate the R-square of the model using r.squaredGLMM() and I don't know...
View ArticleHow to interpret cross validation output from cv.kknn (kknn package)
I'm trying to interpret the results I'm getting when trying to cross validate my data for a k-nearest neighbors model. My data set is set up likevariable1(int) | variable2(int) | variable3(int) |...
View ArticleIs there an R function to fill empty nodes?
I'm trying to scrape IMDB website using CSS selector and xpath. For some film there are missing data, therefore it is not possible to create a dataframe.I would like to find a solution in order to fill...
View Articleh2o.gbm() stop training when a specific AUC (or logloss etc) is reached,...
In h2o.gbm() one can use stopping_rounds to cease training when an improvement in stopping_metric occurs; however, I'd like the training to stop when a certain threshold is reached, regardless of the...
View ArticleCreating multi-category stacked bar charts in R
I'm trying to create some figures to display relative abundances of different trophic groups across 7 sites. The data that I have is set up as: Species, Trophic Group, Specific Trophic Group, Mean...
View ArticleHighcharts Dependency wheel in R
I'd like to create a dependency wheel diagram using the highcharter library in R. Usually I'm just able to look at the javascript code for the plot and translate it for R, but for dependency wheel...
View ArticleHow to shift one specific legend label with subscript slightly downwards?
I've generated a subscript in a legend label with expression() that shifts the entire label slightly upward and looks lousy (the red one in the middle). plot(1:10, type="l") curve(x^2, col=2, add=TRUE)...
View ArticleHow to search by country with twtteR
I'm trying to gather tweets from specific countries, I've been using the following code to search for tweets in a radius around a geo code. And then storing them in a csv file for mapping.tweets <-...
View ArticleR: format a number with Indian Numeric System
How to format a number in Indian numeric system. Eg: XX,XX,XX,XXX.00Big.mark="," formats the number in XXX,XXX,XXX any logic or function available??
View ArticleWorking with "action sequence" data. i.e. vectors with varying lengths for...
I'm a beginner in R and I have to work with some (for me) unusual data for my student job. My boss sent me a script with the following "minimal example" of the data set I'm supposed to work with....
View ArticleBuilt r package: functions with the same name but from different package
I want to write my own package and use "nodes" function from bnlearn and graph package. But when I check my package this warning appears: Warning: replacing previous import 'bnlearn::nodes' by...
View Article