Quantcast
Channel: Active questions tagged r - Stack Overflow
Browsing all 205372 articles
Browse latest View live
↧

Image may be NSFW.
Clik here to view.

Colorbar guide with string labels

I would like to modify the guide_colorbar of a continuous aesthetic with character descriptions, e.g., 'low' and 'high', instead of actual numbers. This can be especially useful when using one legend...

View Article


change name in variables R whit for

I'm trying to create variables to use, for each variable it's called, M000 M001 M002 M003Examplec.n_vars <- nrow(comb) for (i in 1:c.n_vars) { paste("M",comb[i,1],comb[i,2],comb[i,3]) =...

View Article


R - Calculating mean of values in data frame column cycling intervals of...

Starting from a two-column data frame like the following:value - distance (km) 10 1.2 9.5 1.7 10 4 9.5 6.5 10 7 10 7 10 7.6 8.5 11.6 9.5 11.7 8.5 14.8 9 15.2 9 15.3 8.5 17.4 8 17.8 7 21.2 4 24.6 [...]...

View Article

How can I transform a data frame to run chisquared test on it?

word freq.x freq.y 1 1 1 2 1D 1 NA 3 5 2 NA 4 a 5 18 5 a0 8 4 6 about 1 NA 7 all 2 2 8 already 1 NA 9 always 2 2 10 and 4 12 11 another 1 NA Let's say I have a data frame that looks like this. It is...

View Article

Why does my Naive Bayes classifier error out with a Density.default when I...

I am trying to perform a naive bayes classifier and get the following error:Error in density.default(x, na.rm = TRUE, ...) : need at least 2 points to select a bandwidth automatically I'm only getting...

View Article


How do I interpret my categorical coefficient in my mixed-effects linear...

I would like to know how to interpret my coefficient 'Diet' in this multi-level model. The 'Diet' category is 1-4, and refers to what diet the chick is on. Time is in days, and weight is in grams. So...

View Article

Using the dplyr package in Rstudio to display the first 10 rows of a dataset...

So I have a dataset in phpmyadmin and wanted to know how I would display the first 10 rows of the file into rstudio. I'm using the file mtcars and wants to get the first 10 rows and display in rstudio....

View Article

ipwtm function in R: First argument a vector

I want to use ipwtm function in IPW package in r to estimate inverse probability weights,Here are the...

View Article


Error in R : object of type 'closure' is not subsettable

This is my first time posting here so I apologize if I make any mistakes when it comes to the format.I've been working on this project where we have to use ARCH/GARCH models but whenever I tried to use...

View Article


socket.io library in R (e.g. flask-socketio equivalent)

I am running flask-socketio on my python side and would like to connect my R script to it. I have only found websockets as an R library. Is there also a socketio framework out there?

View Article

Convolution of polynomials returns unexpected value

I'm using R 3.6.2 (platform = x86_64-w64-mingw32)In the convolution of the following two polynomial coefficient vectors, I would expect the first entry to be exactly 1.0, but the convolve function...

View Article

Spearman correlation and splitting 1 variable

Year.Sales.Advertise.Employees 1 1985 1.05 162 32 2 1986 1.26 285 47 3 1987 1.47 540 23 4 1988 2.16 261 68 5 1989 1.95 360 32 6 1990 2.4 690 17 7 1991 2.37 495 58 8 1992 3.15 948 75 9 1993 3.57 720 98...

View Article

How do I make column values into new columns in data table?

I have a table that looks like this:> dt variant_id transcript_id is_NL counts nrows 1: chr10_60842447_A_G_b38 chr10_60871326_60871443 0 32968 685 2: chr10_60842447_A_G_b38 chr10_60871326_60871443 1...

View Article


R: fastest way to calculate sum over vector? [closed]

Let k and j be vectors.I need to calculate the value sum(f(j) g(k[i])) for every i = 1, ..., length(k) for two functions g and f (that are vectorized).So, in other words, the sum is over each element...

View Article

Image may be NSFW.
Clik here to view.

How to make the search box have the same format as the output in DT?

I have a simple shiny app in which I display percentages in some columns of a DT table. Is it possible to make the search box have the same format as the output?library(shiny) library(DT)...

View Article


Image may be NSFW.
Clik here to view.

Web scraping html with rvest and R

I would like to web scrape this web site https://www.askramar.com/Ponuda . First, I should scrape all the links that lead to each car page. The extended links look like this in the html structure:I...

View Article

Calling prop.test function in R with dplyr

I am trying to calculate several binomial proportion confidence intervals. My data are in a data frame, and though I can successfully extract the estimate from the object returned by prop.test, the...

View Article


What's the correct way to implement a user-defined do.call's what function?

I have a do.call use-case (as result of calling mclapply) simplified to the following:myfunc <- function(x, y) { str(x) #return(x + y) } res <- list(list(x=1,y=1),list(x=2,y=2),list(x=3,y=3))...

View Article

Error while importing scopus data in bibliometrix

I have a list of 4023 elements that I exported from SCOPUS in the .CSV format. This list can be downloaded at the following address:link to download dataWhen I try to import this dataset in in...

View Article

Updating the same memory (matrix) on parallel computations?

I have a strong use case for parallelizing a flavor of the SGD algorithm. In such use-case I need to update the matrices P and Q with the delta gradient update and for a random batch of samples. Each...

View Article
Browsing all 205372 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>