How do I plot a bivariate function equated to 0 in R and ggplot2?
I am trying to plot a bivariate function equated to 0 in R, using no packages other than the basic packages and ggplot2. Namely, the function is:f(x,y) = x-log(x)+y-log(y)+C, where C < -2Can I plot...
View ArticleFormat table columns as percent, currency for pdf output (Rmarkdown)
I have a Rmarkdown document in which I need to produce a table. The table has several columns, some of which are currency and some others are percentages. I need to produce a pdf output.Sample dataThis...
View ArticleFractional polynomials in a conditional logistic regression model in R
I am working with a conditional (matched pairs) regression model, using clogit in the survival package. I am trying to use fractional polynomials to determine whether a continuous variable ought to be...
View ArticleXaringan: Math renders as inline code in footnote class
Using the default Xaringan CSS, if $math$ is placed in a footnote, it appears to be rendered as inline code, rather than rendering as math. I was not able to find information about this - is this just...
View ArticleHow to analyze categorical outcome, with two categorical predictors, and a...
I have a dataset and the variables are• AGE2015: Covariate, continuous, indicates child’s age as of December 31, 2015, • HAPRETRD: Outcome, Dichotomous, indicates whether the child ever reads or...
View ArticleHow to group_by date to show counts of zero and non zero entries?
I have the following sample data. I am trying to group them in the the various dates and I need new columns to tell me how many zero entries and how many non-zero entries.gantry_date gantry_duration...
View ArticleR while loop at specific times of the day
I have a simple R code that runs once a day to do a specific task. Currently I am using the scheduleR package that has a shiny GUI which allows you to set prefixed time of the day to run the script....
View ArticleCross-validation on comparing linear models
I have 2 linear models to compare: One is reduced model and the other one is full model. I have already done F-Test on comparing 2 linear models. But I do not know how to do this using 5-fold...
View Articleif else statement in shiny not working properly
Below is a script I've been working on. You will notice that the reactive statement, table_data(), is where the heavy lifting takes place. When you run the app, you will see all three filters are...
View ArticleSelecting all rows that match a criteria selected randomly within dplyr
I am trying to select all rows in a repeated measures dataset that belong to a randomly selected group of people. I am trying to do it entirely in the tidyverse (for my own edification) but find myself...
View ArticleMerge the uploaded csv with the current data frame in r shiny
The example that I'm working with is the iris data. If the current data contains iris[1:15,], how can I upload a .csv file with more iris data and click a button to combine the uploaded data with the...
View ArticleI am facing issues while trying to install emojifont package on Mac book
I am installing emojifont package. The package installs properly however when I try to call it through the library function I get the following errorError: package or namespace load failed for...
View ArticleGetting names from list stored in RDS without reading the RDS fully
I have a lot of RDS files, many of them are large and take a while to load. Is there a way to read just the names of the lists stored in the RDS file without reading the entire RDS?
View ArticleCombining Data Points in R [closed]
To start this off I just want you to know I have no idea anything about coding anything. Somehow this project landed in my lap and I am desperate for help so PLEASE.I have a data set and I need to...
View ArticleCan't convert text to numeric
I have this dataset about power outage, by neighborhoods, in Rio de Janeiro: https://www2.aneel.gov.br/aplicacoes/indicadores_de_qualidade/resultado.cfm. However, when I copy it to an Excel file, I...
View Articletable join with exact and "nearest" matches using data.table
I want to do a data.table table join by specifying some exact key matches and some nearest match (roll="nearest"). The example below uses a cartesian join which doesn't work for bigger tables. can I...
View ArticleGrouped Barchart using bargraph.CI
How would I use the sciplot library's (bargraph.CI) to make a grouped barchart showing two bars next to each other for example grass cover and weed cover for the different tree types with the following...
View ArticlerJava is not loading in R
So basically this is the error I'm having when calling rJava:library(rJava) Error: package or namespace load failed for ‘rJava’: .onLoad failed in loadNamespace() for 'rJava', details: call:...
View ArticleEquivalent R codes for Python function numpy.random.normal [closed]
What is the R equivalent codes for Python function numpy.random.normal? I am doing translation from python to R and I encounter this Def generate_covariates(m = 500, d = 10): x = rand.normal(0, 1, (m,...
View ArticleExport data and formulas from Excel models to R or Python [closed]
I have an excel file that has around ten sheets with heavy formulas referencing across multiple tabs used in financial model projection in the last tab. My model mostly has formulas built using...
View Article