Category "r"

Keyboard shortcut for code chunk in R Markdown for windows gives í

Using RStudio for windows. Help says keyboard shortcut for inserting code chunk is Ctrl + Alt + i, which should give me: ```{r} ``` Instead, I get í

How to detect TIME when reading from an excel sheet using R

The issue is that when I read from an excel sheet into R using read.xlsx from openxlsx package, the TIME column is converted into a fraction. Here is an exampl

R package stargazer produces two table outputs instead of one

I'm currently struggling with r markdown, knitr, and, the stargazer package. More specifically, I want to produce the output of a logistic regression: {r table1

URL '/help/library/<package>/r/html/00Index.html' not found when using `devtools::load_all()`

I am using devtools::load_all as a workflow to iteratively make a package. However, I cannot seem to be able to view the package documentation using ? or help(p

Does anyone know how to plot long term spectral averages (LTSA) and PSD in R?

I'm trying to make some plots to document the soundscape of a large dataset of .wav files Essentially, I have a series of consecutive 10-min 24-bit files for ab

Computation failed for stat_summary, 'what' must be a character string or a function

I am trying to following the script/example on ChickWeight plotting raw data in "Independent Group T intervals test", but keeps running into the following error

How to make predictions even with NAs using predict()?

I want to use predict() with a polr() model to predict variable z, as per the following code. This first is the df to train the model and the subsequent test da

Computation failed for stat_summary, 'what' must be a character string or a function

I am trying to following the script/example on ChickWeight plotting raw data in "Independent Group T intervals test", but keeps running into the following error

Is it possible to use geom_insert() in ggtree for circular trees?

I am trying to to include my results of ancestral state estimation as pie charts at the nodes of a phylogenetic tree. It works fine for rectangular trees but I

How to fix 'Error in if (nchar(text.matrix[r, c]) > max.length[real.c]) { : missing value where TRUE/FALSE needed' using stargazer in rstudio?

I'm trying to print a table of combined lm's in Rstudio using Stargazer and I keep getting this message: Error in if (nchar(text.matrix[r, c]) > max.leng

dbAppendTable() error when I try to append data to a local server

I'm just starting my journey with r, so I'm a complete newbie and I can't find anything that will help me solve this. I have a csv table (random integers in eac

Scraping content from urls in dataframe using R

Sorry, I'm relatively new to R and don't know it very well yet. I have also seen that similar questions have been asked more often. However, the corresponding s

How can I freeze the first column in DT without increasing the column width of a table with rotated (90°) column names?

I want a table of the format of table dt1 (rotated and freezed column names, narrow column width, scrollbars horizontally and vertically) plus freezing the firs

Apply a function over all combinations of arguments

I would like to be able to apply a function to all combinations of a set of input arguments. I have a working solution (below) but would be surprised if there'

How to create a range of dates in R

From two integers (1, 5) one can create a range in the following way 1:5 [1] 1 2 3 4 5 How can you make a range of dates if you are give two dates ("201

How to order frequency from highest to lowest for character variable

Suppose my dataframe (df) only includes this single character variable: race.ethnicity<-c("W", "C", "F", "F", "J") I want to create a frequency table for th

How does the overloading of the assignment operator in combination of the length function work?

How does the mutating implementation of length() actually work? Example: Given a vector v, how does this set the length to 12? length(v) <- 12 Can I create

Interpretation of a binary regression plot

I'm new to R and I created an avplot of a linear binary regression. I was wondering how do I interpret the regression residuals in the corner like that? Would y

Git tab missing in RStudio after git installed on Windows

Installed R, R Studio, Git but when I opened R Studio, there was no Git tab, like the screenshot below: Windows 8.1, x64 R version: 3.5.1 R Studio version: 1.

R - pass a global variable to a function, modify it and save

I'm trying to build a dynamic function utilizing eval,parse, or whatever works Intention of a function: a value setter. Parameter input: list, name of list it