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 ArticleCalculate 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 ArticleR 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 ArticleR 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 ArticleHow 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 ArticleError 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 ArticleSeparating 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 ArticleHow 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 ArticleIs 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 ArticleIs 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 Articlecondition 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 ArticleCan 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 ArticleCan 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 ArticleHow 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 ArticleDegree 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 ArticleR 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 ArticleLower 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 Articledifferent 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 ArticleHow 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 ArticleText 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