Error in RGEOSBinTopoFunc when croping a SpatialPolygon in R
I have a weird problem, I can't crop a SpatialPolygonsDataFrame when I use certain extents in my Ubuntu 18.04 laptop with my R version 3.6.2, this is a reproducible example, where it works with one...
View ArticleHow do I count the associations between each variable and value in R?
I have a large data frame with 31 Columns (V1:V31) and a large number of rows that have different combinations of V1:V31. The NAs indicate when that variable was not part of the combination. The...
View ArticleWorking with large matrix field in R6 object is slow
I'm creating a matrix, representing a certain value for a combination of customers (rows) and features (cols). Let's call this matrix NBA. Based on data received through an API, this matrix needs to be...
View Articlechange of histogram to line plot by ggplot
I need to plot the geom_histogram but as the plots overlap, I want to plot it linear instead of bars, i.e, the x=hp, y=count (percent). Can anybody please help me find how to do it.library(ggplot2)...
View ArticlePivot Table in R, Summarizing Based on Most Frequently Appearing Value in...
I am attempting to create a pivot table in R.I have code like so:Grps <- c("MoveNumber","TripOrderNumber","BillToParentAssignment","AccountOwner","MonthYear", +...
View ArticleMutate based on conditional lag
I have data from an IM chat, where each row is a keystroke. I would like to automatically add the column most_recent_enter (manually added here, for an explanation), where it tracks the most recent row...
View ArticleHow to do 1000 permutations of column names with test statistics distribution?
let's say I have a matrix like thisdat <- read.table(text = " code.1 code.2 code.3 code.4 1 82 93 NA NA 2 15 85 93 NA 3 93 89 NA NA 4 81 NA NA NA", header = TRUE, stringsAsFactors = FALSE)...
View ArticleIs it possible to calculate the standard error of beta0 and beta1 with only...
How do you calculate the standard error of beta0 and beta1 using only their Estimates and Confidence Intervals and the qt function in R?Example: Est SE L U beta0 1.13 0.241 0.889 1.37 beta1 3.57 1.620...
View ArticleIs there anyway to set the counties' border line colors in county_choropleth?...
My data includes FIPS code, County Name, and Population size. Using the choroplethr package, my current code iscounty_choropleth(Countydata, legend = "Population",county_zoom =TennCounties) Is there...
View ArticleHow do I get the coefficients of my mean equation when using sGARCH?
I hope someone can help me with the following basic question regarding GARCH in R:Trying to find out whether there is a day-of-the-week effect in some indices I have done the following OLS in R:𝑅𝑅𝑡𝑡 =...
View ArticleHow do I convert the results of survey::syvratio into a dataframe?
I have calculated ratios for a few variables using svyratio, but it doesn't let me convert the return value into a dataframe. Using DF1 <- as.data.table(loc_ratio), it gives the error "Error in...
View ArticlePackage development: How can I import data from a package, transform it, and...
Using the roxygen2 framework how can I import a data set from another package, perform an alteration, and reexport the data set as a dataset within my own package?In my experience with exporting data...
View ArticleUse eventClick in FullCalendar (in Shiny)
I have a fullcalendar in shiny that I would like to incorporate "eventClicks" into. Ideally, I would like for additional information to be shown in a pop up/hover over text box when clicking on one of...
View Articlehow to use an R script from github?
I try to use sources creates from github plugin-draw.R how use this plugin?
View ArticleApply operation on all pairs of rows
I have a tibble in this format: position condition replicate value <dbl> <chr> <chr> <dbl> 1 10 1 a 0.16 2 10 1 b 0.21 3 10 2 a 0.19 4 10 2 b 0.38 5 10 3 a 0.12 6 10 3 b 0.35 7...
View ArticleAdd thousands of columns using if_else/summarize in dplyr chain?
I have data comprised of state-group observations (ie fast food companies in states). Multiple observations of the same state-group in the same year are common. Each row contains a value (ie number of...
View ArticleR shinyBS modal pop up stopped working and can't make it to work with Shiny...
I have a simple example below of a shinyBS modal pop up concept upon a user entering the site. This was working fine, and now suddenly stopped working. I have shiny server pro. Not only does the modal...
View Articleh2o in R: model calculation hangs
I cannot figure out why my random forest grid search hangs. I tried many things suggested on Stackoverflow, but nothing works. First of all, here is my code:library(data.table) library(h2o)...
View ArticleHow to store different outputs inside a funcion? [duplicate]
I want to store different output variables that are calculated inside a function. I coded a toy example:f = function(number) { xx = NULL savexx = NULL savexx10 = NULL for (i in 1:10) { x = number*i xx...
View ArticlePython total sum from a csv file
i have 133 CSV filesthe first file file1.cvs have the following data : A b C Name 2 Value jack 3 2% jack 3 1.33% jack 4 1.112% sara 5 4% sara 6 9% adam 1 7% adam 2 10% nada 3 3% nada 4 1% tom 5 1% i...
View Article