Extract array of objects from string in R
Suppose i have the following string:str <- "var x = 1; var b = [{a:c, d:f}, {aa:cc, dd:ff}]; var notOfInterest = {cc:r, dd:w}"I would like to extract all objects within that array "[{...}, {...}]"...
View ArticleTime series vectors of quarter plot
I think my plot looks a bit silly, can u help me out? It's actually my second plot, what i think looks weird, but you probably need information of this first lines of code as well. first_dif <-...
View ArticleJoining two tables in a square matrix in R and Stata
I have two tables that look like this:TABLE 1 (2.497.968 rows) - each row contains an ID (specifically, it represents a firm) and a place (the municipality where the firm is located) c1 (ID) c2 (PLACE)...
View Articler Web scraping: Unable to read the main table
I am new to web scraping. I am trying to scrap a table with the following code. But I am unable to get it. The source of data is...
View ArticleConsole output alignment for R-to-L languages (e.g arabic)
I have a problem whenever I use head() or table() or similar commands. In the console output, column names and data are mismatched and wrongly aligned. I've already set Sys.setlocale("LC_ALL",...
View ArticleHow do I get output after applying a dictionary to a DFM?
Hey Stack Overflow peeps, I've currently analysing some small text data suing a dictionary i constructed. I've tried applying my dictionary to my DFM by using dfm_lookup function, but i cannot recieve...
View ArticleSumming specific values in a row
I am currently working on the data displayed on the picture below and I would like to draw a cumulative plot of the number of animals specified by the data for each year. enter image description...
View ArticleWald/LRT/Score Hypothesis test in R for multinomial model
For multinomial and ordinal models in R via the nnet package and MASS package, respectively, how do I get an LRT, Wald test, and Rao score test for the full model and various groups of coefficients...
View ArticlePlotting estimated polynomials in R using lines() and predict()
I'm somewhat of a rookie, but trying to plot 6 parameter values against 6 means. I have this code:meanGdEV = c(-0.74085561, -0.50071115, -0.29904040, 0.05227249, 0.43114683, 0.83719626)...
View ArticleIssue when rendering an animated plot using gganimated
I'm using the gganimate package in R to animate my plot. It works well but the flags are repeated and the first three images get stuck also.data_rates_plot %>% ggplot(aes(x = Year, y = Rate, group =...
View ArticleHow can I read or download an image from a Google Sheet or google sheet cell...
This is what I tried: library(googlesheets) sheetPath = "urlToFile" workSheetName = "sheetName" gs_title("Gapminder") %>% gs_download(ws = "workSheetName ", to = "imageToSave.pdf") I'm currently...
View ArticleHow to make a faceted waffle chart, filling each bin from top left
I'm trying to create a 3x4 grid of bins with a count of observations from my data in each bin. I'm halfway there:library(ggplot2) type <- c('daily', 'daily', 'habit', 'habit', 'habit', 'seasonal',...
View ArticleHow to pipeline data into stat_function() in tidyverse in this case scenario?
For the data set below I want to plot histograms overlaid with the normal distribution curve using the dnorm function inside stat_function(). MWEstructure(list(Carrot = c(-7.52760119913518,...
View Articler - pass string stored in variable in dplyr function
I want to supply a string stored in a variable as a new column name while performed a dplyr group_by function. How can I retrieve the value stored inside the variable, and not the name of the variable,...
View ArticleHow to modify this code, so that it could display the objects in table stroop...
bitmaps instruction1 instruction2correctmistakefixpointyellowyellowyellowgreen...
View ArticleIntegration in R language
I'm trying to compute the integral between 1 and some cutoff 'cut' of the function given in the R-code below as 'int'. It depends on 2 parameters dM[i] and dLambda[j] defined before I make the...
View ArticleAutomatically remove R6 object
I have created a bank account class with the R6 package . It has a balance that is private (not accessible after generation) and methods to withdraw and deposit a certain amount as well as a print...
View ArticleR: Ploting Moran I plot in ggplot
Helo I would like to ask how to convert clasic R plot in ggplot so it looks nicer, in my case I would like to plot MORAN I plot in ggplot.example:library(spdep) data(afcon, package="spData")...
View ArticleUsing predicted log change values from regression to predict future prices
I had this problem I was hoping someone could help me with. I have a data set which shows the prices of multiple goods (each a column) on a daily basis for some years. I've run a regression like below...
View ArticleData Concurrency within variable
I have data named as my_data. The amount of data is > 100000. Sample output is like below: id source 8166923397733625478 happimobiles 8166923397733625478 Springfit 7301100145962413274 Duroflex...
View Article