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

Efficiently picking combinations of Integers

Let's say we have a 5x5 matrix, filled with 0s.myMatrix <- matrix(rep(0, 25), ncol = 5) Now, let's pick a triplet of integers between 1 and 5.triplet <- c(1,2,3) For all combinations of this...

View Article


Is there a pandas equivalent to the tidyr nest function?

The tidyr::unnest method from the R language as an equivalent in pandas and it is called explode as explained in this very detailed answer. I would like to know if there is an equivalent to the...

View Article


Deploy Kera/Tensorflows model as a package in R to production

A little background to understand my problem:My company uses a private server to put our ML models into production using opencpu. The ML models, which were generated using Caret, are usually written...

View Article

Check value of a variable while R session is running

Is there a way to check the value of a variable in the script while it is running? One way could be to setup print commands in the script to print the value of the variable periodically. But I forgot...

View Article

Find the times an object has the maximum value in Rstudio

I have an object with values of how many votes each politic party has in each location of a country (950 locations and 8 parties).I would like to know how many times a party WINS (how many times it...

View Article


File opening error while running Rscript as cronjob

I am trying to run an R script as a cronjob with a conda environment. Running the script from terminal works well with following script.sh/opt/anaconda/anaconda3/envs/{env-name}/bin/Rscript...

View Article

Image may be NSFW.
Clik here to view.

Add text shadow/outline to text labels in R plotly

I'd like to see if I can add a black outline to white text in a plotly chart in R.I found the following link describing how it could be done in plotly.js but not sure it can be done in R as of yet....

View Article

How to connect to Snowflake database through R if MFA (multi factor...

I am working on a project which requires me to connect through R to a Snowflake database to pull data from it. However, since we use multifactor authentication to access the DB. I couldnt establish a...

View Article


Access dynamic id in shiny R

So this is an extension to my previous question.Dynamic repeating conditionalPanel in R shiny dashboardHere is the shiny code I am using right now.library(shiny) library(shinydashboard) ui <-...

View Article


Barplot subgroup factor reordering doesn't work

I want to order each bar within year like this: A, B, C.I have looked at this post: https://ilari.scheinin.fi/ggplot-2-0-and-the-missing-order-aesthetic/but it doesn't work at all.Here's my code:# data...

View Article

Vertex label color -igraph

How to change the label color of subset of nodes in a igraph object? The following code works fine with label color of all nodes given in black. g <- plot(graph, layout=l, edge.arrow.size=0.5,...

View Article

How to make sure R Integrate function skips a value where the function is...

I have a function f which is defined with the help of function g. I am trying to calculate its entropy h_f. The error I get is the integral is probably divergent. My R code is the following: phi <-...

View Article

Trouble converting list to dataframe

I have a list that's called my_list and looks like this:$love playing working sleeping 0.43 0.56 0.88 $will otherwise rework rule 0.87 0.23 0.11 $new car shirt 0.23 0.12 I want to convert it to the...

View Article


Is there a way to run saved bigquery in RStudio directly using the link?

I have a query saved on BigQuery and I wish to find a way to run it directly on RStudio without copy-pasting it. Is there a way where I can use the link of the saved query to tun it in RStudio?

View Article

Image may be NSFW.
Clik here to view.

How do I reduce the space between geom_text labels?

I have managed to construct the following plot, in which I use stripped down plot containing only geom_text labels to showcase in-group populations for another plot:The distance between the geom_text...

View Article


Image may be NSFW.
Clik here to view.

R studio code execution error (file name conversion error)

Suddenly above error messages come when I type a single character on my R studio script window. What is the reason? And Is there somebody tell me how to fix it?

View Article

Converting dataframe to structured list

In the following .RData file:https://www.dropbox.com/s/ct6ttye8mmci22v/Test_Data_Colours.RData?dl=0I'm looking to convert the dataframe b into a structured, dictionary list (an example of which is...

View Article


problem with variable selection in nc file: "vobjtovarid4" problem

I am having problems with a file of Arctic Sea Ice Seasonal Change and Melt/Freeze Climate Indicators from Satellite Data (https://nsidc.org/data/NSIDC-0747/versions/1). I am trying to extract some...

View Article

loop for Principal Component Analysis does not work

I have two dataframesdf1 <- data.frame(item1 = c("5", "8", "2"), item2 = c("2", "2", "6"), item3 = c("4", "78", "76")) df2 <- data.frame(item1 = c("54", "82", "12"), item2 = c("6", "7", "87"),...

View Article

Merging a list of data.frames with purrr (reduce/reduce2)

This is my data:list_of_data <- list(mtcars[1:26,], mtcars[4:22,], mtcars[3:15,]) I want to merge the all dataframes by their rownames.Merging a lot of data.framesI know that Reduce comes pretty...

View Article
Browsing all 206180 articles
Browse latest View live


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