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

Make a file writable in order to add new packages

I use Rstudio and try to add new packages through command console.It fails to install it for this reasoninstall.packages("devtools"); devtools::install_github("hadley/rvest") Warning in...

View Article


Adding custom ActionButtons to popups in leaflet map within shiny app

I'm trying to build an app in R shiny where users can learn details about points on a map. When users click on a point, a popup shows some initial details and then an ActionButton (or ActionLink). When...

View Article


Different result grep() and "=="

I have the following dummy data.frame:setseed(666) df<-data.frame(ID=rep(c("A","B","C"),each=11),Year=rep(2010:2020,each=1,3),x1=floor(runif(33,0,10)),x2=floor(runif(33,0,2)),...

View Article

Is there a code implementation in R of the Louvian method for community...

I am working on a problem that needs to do community detection with a specific modularity function in mind. I need to have code implementation which maximizes my specific modularity function across...

View Article

Image may be NSFW.
Clik here to view.

Applying melt function to multiple .txt files

I am having multiple .txt files each representing some parameters in the following formatParameter1 = structure(list(Year = 1969:1974, Jan = c(16.6, 15.6, 15.8, 16.9, 16.2, 15.4), Feb = c(17, 15.2,...

View Article


Is there R code to find across models, find any drugs that have ≥1 gene...

I am working on gene expression by drugs in across 3 models, for +ve control drug(s) - I want to write R code find any drugs that have ≥1 gene across 3 models in the datasets

View Article

How to write a command fuction for the step function learner

Data have just y and x as output and input variables.We are interested in constructing a step function learner as follows:First draw a random number U uniformly on the interval spanned by the minimum...

View Article

Trying to find the number of diagonals of 1 in each 3x3 tile in multiple...

I am trying to find the count of diagonal 1s in each 3x3 tile e.g.0 0 1 1 0 0 1 1 1 0 1 1 0 1 0 0 1 0 1 1 1 0 1 0 1 0 0 or 0 0 1 or 1 1 1 or 1 0 0 just for example where it doesn't matter about the...

View Article


Bold/highlight single line in multiple line chart when hover over using ggplotly

I just started learning R and I am creating an interactive line chart using ggplot2 and plotly.Is there a way to bold/highlight the corresponding line in a multiple line graph when the mouse hovers...

View Article


Quantile Regression in Python gives different results than in R

QuantReg from statsmodels package in Python gives very different results than in R, using the data as shown in the following code.I tried the STACKLOSS data in Python and R respectively, and the...

View Article

String match in r

I have two data frames D1 and D2 as mentioned below I want to compare D1 and D2 like "Issues" of D1 with "list_of_issues" of D2 `ID = c(1, 2, 3, 4) Issues = c('CI', 'E,CI', 'H,A', 'CI,E') Location =...

View Article

Connecting Rstudio with PostgreSQL in AWS EC2

I am currently running PostgreSQL server in AWS EC2 (Ubuntu) and having trouble accessing it from local server. How can I access remote database from local RStudio? Code in R:library(RPostgreSQL)...

View Article

Different time_lengths for interval, duration and period

I am new to lubridate. I tried to calculate the difference between two sets of time with lubridate but get slight different answers for interval, duration, and periodlibrary(lubridate) a <-...

View Article


How to determine the source of a function conflict in R

I am working on a large project with many libraries. I am running into a function conflict with dplyr::select(). Clearly there is another library loaded somewhere that also has a select() function. How...

View Article

How would I output the maximum euclidean distance between any two 0s in a...

I am trying to find the Euclidean distance between any two 0s in a list of data frames. Firstly, I have outputted the positions of each 0 for each data frame in the list...csvs <-...

View Article


When comparing a model with new/unseen data using RTextTools, how to extract...

I used RTextTools for train and validation of a sentiment data-set, which produces the output fine with precision recall and F1 score. However, when I use this model against new/ unseen data-set I can...

View Article

Overlay two stat_density plots

I'd like to overlay two density plot from two one-dimensional array. I need them both in log-log scale. The files contain just the list of numbers (1.000.000) both generated from very similar specific...

View Article


Rstudios sarima show only plots

I have the following code that I am running in Rstudios:```{r} library(astsa) data = c(1:500) mo1 = sarima(data,0,0,2) ``` It produces both the five plots I am interested in and output from the...

View Article

r^2 LD index value when the AB allelle freq is known

This is the second day I try to solve the Japanese sudoku.The answer needed is the r^2 LD index value rounded down to 3 decimal places when A-B's frequency is equal to 0.2. There are two SNVs, SNV A...

View Article

R phyloseq tax_glom used in a function give a error

I'm trying to make a function to obtain a table in a relative abundance of any given taxrank with PHYLOSEQ, something like:Relative_Table <- function (PhyloObj, TRank) { GROUP <-...

View Article
Browsing all 206180 articles
Browse latest View live


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