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

Image may be NSFW.
Clik here to view.

Custom axis breaks in ggplot2 facets based on other columns

I have data to plot, where the x-axis is found in one column, and the x-axis major breaks are found in other columns.For my sample data, I will modify the iris dataset from ggplot2. Note: the low and...

View Article


Image may be NSFW.
Clik here to view.

Calculate diameters at specific heights based on taper ratio?

I am trying to figure out the relationship between the taper ratio and tree diameter (at breast height = dbh) at specific heights of the tree. Taper is a ratio between diameter at dbh and tree height...

View Article


R how to visualize confusion matrix using the caret package

I'd like to visualize the data I've put in the confusion matrix. Is there a function I could simply put the confusion matrix and it would visualize it (plot it)?Example what I'd like to do(Matrix$nnet...

View Article

R shiny router redirect to URL containing parameters

I want to perform redirect to URL with parameters, like https://www.google.com.tw/webhp?newwindow=1, which works well in basic shiny app as below:library(shiny) jscode <-...

View Article

Image may be NSFW.
Clik here to view.

How do I center my text labels (showcasing in-group populations) vertically?

I have the following plot, describing the distribution of academic credits depending on wether you live close to campus or some distance away:The code is as...

View Article


Error in normalizePath(key$InstallPath, mustWork = FALSE, winslash = "/") :...

I am trying to install the package "mdatools" using install_github to get the current developer version as recomended in https://github.com/svkucheryavski/mdatools. But when I run:...

View Article

Separating a column in multiple columns in R

Here is my data:df1<-read.table(text= "Group 11Z-23456 12B-10000 22M-2000 12M-1100 33G-100",header=TRUE) I want to get this data:A B C Code 1 1 Z 23456 1 2 B 10000 2 2 M 2000 1 2 M 1100 3 3 G 100 As...

View Article

How to repeat elements in c() function?

I am using the combine function c() to define the gradient:eval_f <- function( x, param, n ) { return(list("objective" = x[5] * (param[1] - param[2] / sum(x[1:4])), "gradient" = c( x[5] * param[2] /...

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


Is dplyr.snowflakedb only running with 32-bit JDK?

I cannot install the package on my Windows 10 64-bit PC. I've got the latest version of R installed which was required to install RJDBC and rJava is loading and running without any issue on all the...

View Article

condition for comparing two columns

I have a dataframe with four columns, the first one has the names of counties, the second one has periods in it and the third one has actual measured values(IPC class) in it and the fourth one has...

View Article

Can I use R to only analyze data past a certain date?

I have an excel sheet that I imported into RStudio which contains data for every subject of a certain population. Each subject has their own set of data with corresponding dates, but I only want to...

View Article

Can we check shiny applications using testthat and usethis

is there a way to check the below applications. This is a sample application to display selected rows. But in general is there a way to acheive this. For example the below code is perfect. Suppose I...

View Article


How to save all columns after mutate_each?

I have the task: to convert some given columns into factors, all other columns should stay as is. Criteria for converting into factor: if the meaning is less than the column mean, than it is 0....

View Article

Degree Centralization in Igraph for R - star graph not evaluated as 1

I'm working with a series of undirected small graphs using igraph in R. I'm interested in graph-level degree centralization, and am using the centr_degree function from igraph. However, I noticed that...

View Article


R doesn't want to read emojis from Google Sheets

I'm coding in R language.I've made a survey on Google Forms and send results to Google Sheets.Then I tried to download results to R:url =...

View Article

Lower one value by a ratio in a formula

I have a value d at maximum height h_max. This value should at each interval decrease by specific ratio. Let's say:d = 10 ratio = 1/100 # or 1:100 outside R So, at intervalsh = 100*c(1:h_max) my d_h...

View Article


different logic when translating Python code to R

the following Python code was translated to R Python code:plan_no_harvest_collision = [] for plan in only_all_plants_full: harvest_plan = [] for house in plan: harvest_plan_per_house = [] days = 0 for...

View Article

How is data considered for data analysis [closed]

In real life scenario the data set size will be large.How does data scientist analyse the date? Question 1:Do they download and import the whole file into the tool and take a sample out of it. Question...

View Article

Text Input in DT::datatable unbinds and I can't rebind it

I am working on a shiny application that allows users to enter comments about an observation. The comments are then saved in a SQL database on the back end. The code below is a working representation...

View Article
Browsing all 209005 articles
Browse latest View live


Latest Images