Predict a factor of 3 levels and return the % of each factor
I am trying to predict a three-level factor with a set of variables. The group is A, B and C.m<-glm(as.factor(Group)~Sex+BloodType+Pressure,data=Hel,family = "binomial") newdata <-...
View ArticleGarbage Collection in R process running inside docker
I have a process where we currently large amount of data per day, perform a map-reduce level of functions and use only the output of the function. We currently run a code sequence that looks like the...
View ArticleWeb Scraping image in R from www.zoobashop.com
I am collecting wax images for my classification algorithm.At first I recovered all the links of the image blocks. Each block contains 1 or 2 images that I want to get back the links.For example on...
View ArticleSummary command in logistic regression in r [closed]
If this is a data frame Cust I'd. Consumer spending. Area Sales made 1. 1$100-$200. Urban. 1 2 $200-$300. Suburban. 0 3. $300-$400. Suburban. 1 . . . . . . . . . . . .Then on doing modelling through...
View ArticleSimultaneously permute rows and columns while constraining by other factors
I am working in R with a dataset that has this structure:plt <- c("W","W","W","W","W","W","W","W","W", "Z","Z","Z","Z","Z","Z","Z","Z","Z") siteA <- c("a","a","a","b","b","b","c","c","c",...
View ArticleIs there a way to give each subset from a dataframe a different object name...
I need to make different subsets from one data.frame, and then use these different subsets for subsequent actions. Therefore, I need to give each subset a unique name. I tried writing different...
View ArticleR help converting factor to date
I imported a csv file with dates from a SQL query, but the dates are really date-time values and R doesn't seem to recognize them as dates. How do I convert them to dates? (I don't need to include the...
View ArticlePerform a bootstrap to estimate these standard errors
log_mod <- glm(formula = y ~ x1 + x2, data = dat, family = "binomial")Perform a bootstrap to estimate these standard errors ourselves. It works as follows: i. Sample 2000 $(X_1,X_2,Y)$ triplets with...
View ArticleHow do you remove the academic and demos sections from the main page of the...
I created a site (https://www.dsobolew.me/) using blogdown and the Academic hugo theme. I want to remove the Academic and Demos sections on the main page so the first thing that appears is the...
View ArticleHow to lag dates based on multiple conditions and reseting the lag after it...
I have a dataframe of station repairs.The workflow is like this: Mechanics go to a station and they press a button that records an action named release. After they fix the station, they press the...
View ArticleDynamically create dataframe
I want to create a dataframe with columns names given by user. Like I have some textInputs(name1, name2, etc) and textInputs(value1, value2, etc). Now I want to create dataframe with entries in name1,...
View ArticleCalculating density within a shapefile
I'm trying to calculate density within a shapefile, but I'm fairly confident I'm doing it wrong. The idea is to figure out which geographical regions there have been the most sales by density.Here is a...
View ArticleSplit column to multiple columns by using R or python
I have a value like that and I would like to split it to multiple columns[['Alonso, O.', 'Mizzaro, S.'], ['Gao, H.', 'Barbier, G.', 'Goolsby, R.']] I just wanna the value like 'Alonso, O''Mizzaro,...
View ArticleNeed help adding column with associated characters
Table before adding associated cost vectorI am trying to add a new column that has an associated cost depending on the item code listed in the first column.Here is the price sheet:| Item | Price...
View ArticleHow can I scrape table from PHP website using R?
Looking to import data into R from a table on this page:https://legacy.baseballprospectus.com/standings/index.php?odate=2019-09-10I've tried multiple methods using XML and httr with no luck. Have...
View ArticleHow do I run a linear regression between certain observations in a data set?
my problem is that I am unable to run a linear regression between say the 450th and 500th observations of NBA salaries (the salaries only in the year 18/19 in my continuous data set).So far I have this...
View Articleggplot2 with summarize as y aesthetic - r
Here's my task:Create the following graph:Group the Pokemon data by type1 and is_legendarySummarize the data with the mean of the attackCreate a bar chart with type1 on the x, the mean of the attack on...
View ArticleHow to make my graph legend not a gradient? ggplot2, tidyr, poisson...
This is kind of a really small issue, but I can't rectify it without causing unwanted ramifications... unless someone can help. I'm doing a poisson regression and I have 7 predictor variables, 3 are...
View ArticleSort data frame by character and date columns
I'm trying to sort a simple dataset by a character column (descending) and a date variable (ascending). fx_code date fx_spot 1 AUD 2000-01-31 0.6370 2 AUD 2000-02-29 0.6178 3 AUD 2000-03-31 0.6071 4...
View ArticleChanging the fontsize of axis annotations in a hexbinplot
I would like to increase the font size of axis annotations in a hexbinplot.library(hexbin) df <- data.frame(x=rnorm(1000),y=rnorm(1000)) hb <- hexbin(x=df$x, df$y) myPlot <- plot(hb, xlab="",...
View Article