C functions in R packages - Rsession aborted when function ends
The problemI am trying to wrap old C code into an R package.So far, I have managed to get RStudio to compile the code, export the function, and everything in the function's body executes properly right...
View ArticleHow do you run an R script for ML in PowerBI?
What is the best way to deploy a machine learning script written in R (ie. linear regression, random forest, k-means, etc.) to PowerBI? Here is what I am currently thinking: My response column is...
View ArticleConnecting multiple server PostgreSQL R
I needed to put 3 shards of a database on three different servers. So I created 3 servers in pgAdmin(s1,s2,s3), then I put each server one shard. Then, I tried to connect one of the servers in R;...
View Articlesubscript out of bounds when using broom::tidy() on a svyglm with a...
I'm getting a subscript out of bounds error when using tidy() on a svyglm where one of the covariates does not vary:library(broom) library(tidyverse) library(survey) test.df <- tibble( id =...
View ArticlePlotting distribution of all columns for 2 different factors using ggplot?
I have a data frame that can be generated as follows:DD <- data.frame(group = c(rep("A", 5), rep("B", 6)), Feat1 = rnorm(11), feat2 = rnorm(11,3,5), feat3 = rnorm(11), feat4 = rnorm(11,2,3)) I would...
View ArticleFilling gaps before, between and after spells (date ranges) in R
Imagine that you have a data frame of three study participants with their dates of entry (doe) and exit (dox): > participants <- data.frame(id = 1:3, + doe =...
View ArticleHow can I calculate distance between multiple latitude and longitude data?
I have 1100 station location (latitude and longitude) data and 10000 house location (latitude and longitude) data. Is it possible to calculate the lowest distance between station and house for each...
View Articlehow to convert a large dataframe based on columns into a list of dataframes in R
i have a large dataframe with 1365 columns as shown in the example: df <- data.frame(X1 = c(7.48, 7.59), Y1 = c(49.16, 48.70), ID1 = c("B_1", "B_1_2"), TI1 = c(191.31, 1349.93), X2 = c(8.15, 8.06),...
View ArticleConverting to date in a character column that contains two date formats
I have CSV file with "date" column but it contains two different date format as the following7/12/2015 15:28 as m/d/yyyy hh:mm 18-04-2016 18:20 as d/m/yyyy hh:mm How can I change the format into...
View ArticleCount order values in a row, over a column
I have a dataframe with 3 columns: A, B, C In each column there is values going from 0 to 10 I want to figure out how often each possible size orders occurs e.g.:A>B>C #? A>C>B #?...
View Articlerbind(x, y) vs. rbind(y, x)
What differences are there between rbind(x, y) and rbind(y, x)?Why I ask: Out of desperation I tried both and noticed one worked. Where rbind(x, y) gave me Error: charToDate string is not in an...
View Articleggplot2 plots the two variables in the same plot but one variable with...
I have one following example data:df2 <- data.frame(supp=rep(c("VC", "OJ"), each=3), dose=rep(c("D0.5", "D1", "D2"),2), len=c(6.8, 15, 33, 4.2, 10, 29.5)) Normally we plot the two variable VC and OJ...
View ArticleError: Memory Exhausted (limit reached?) R code Windows Task Scheduler
I am attempting to use Windows Task Scheduler to automatically run R code daily using instructions from another StackOverflow question (Scheduling R Script). Window Task Scheduler correctly opens...
View ArticleIs there a package to embedd a Tableau table into an R Shiny app? [closed]
I am working on creating a mock-up of a future shiny app that will take the place of Tableau. For now, the app just needs to show what the Tableau dashboards already look like so we can get it...
View ArticleExtract different set of rows from data frames in list
It is going to be hard to give you a reproducible example but in general it supposed to be an easy task for many of you. My brain has not yet switched on after midday coffee.I have a list of 20-30 data...
View ArticleOsmar package in R "Error in file(con, "r") : cannot open the connection"
I am trying to run the osmar package on my windows 10, R 3.4.2, and have correctly installed osmosis. However when I try to run the code:>library("osmar") > >src <- osmsource_osmosis(file =...
View Articleload(url(....)) vs download.file in R. Why the latter doesn't work when...
I'm reading some of my old R notes and I'm faced with something that make things confusing to me. Here you can find a dummy database with .Rdata extension. When I use load + url the database is...
View Articleif_else using each element of a conditional vector individually
I am writing an R program that uses user defined functions to create objects to clean/manipulate our raw data. One of the tasks I am asking of the program is to recode (effectively switch) some portion...
View ArticleEquation on Graph Issue: Computation failed in `stat_poly_eq()`: variable...
I am trying to create a graph for my thesis data and am receiving the error message below. The graph runs, but the equations are not printed on it. I can't figure out what the issue is. There was a row...
View ArticleHow to filter data with dplyr to retrieve NAs along with another value together?
I have a dataset that looks like this X Y 121 Yes 122 No 123 NA 124 Yes 125 NA How can I filter out the "Yes" values from column Y ? I only want 'No' and 'NA'My Desired output is this X Y 122 No 123 NA...
View Article