r Questions
5
Solved
I have some archived Slack data that I am trying to get some of key message properties. I'd done this by stupidly flattening the entire list, getting a data.frame or tibble with lists nested in som...
2
Solved
Given the following plot:
library(tidyverse)
p <- ggplot(mtcars, aes(drat, disp)) +
geom_line()
p
layer_scales can be used (here) to extract breaks/break positions from most ggplot objects li...
5
Solved
is there a way to dynamically access an array dimension (ideally without reshaping)?
I have an n-dimensional array arr as well as a named order of dimensions vals.
Both the number of dimensions for...
4
I'm looking to count how many values in a row are identical. The idea is to be able to filter out respondents that have straightlined (ie answered all questions the same), for instance by filtering...
Baucom asked 31/10 at 1:42
4
I use BottomNavigationView in my App, but I have a problem: in BottomNavigationView.java there is import com.google.android.material.R and R is red and write "Cannot resolve symbol 'R'".
The topics...
Glabrescent asked 15/10, 2019 at 17:40
5
Solved
Just like the question says. Is there a faster way to do what is done below when the vector size is very large (> 10M entries) using base R?
The code below works, but when the vector size ...
Disreputable asked 25/10 at 13:16
2
I recently updated R and R studio and when I tried to save a file, I received an error message that said:
Error saving (file name). The wrong diskette is in the drive. Insert %2 (Volume Serial Numb...
2
Solved
I want to put confidence interval error bars for ggplot.
I have a dataset and I am plotting it with ggplot as:
df <- data.frame(
Sample=c("Sample1", "Sample2", "Sample3", "Sample4", "Sample5"...
3
Solved
I have the following data:
df <- structure(list(id = c("1358792", "1358792", "333482", "333482", "747475", "747475"),
x = c("123...
2
Solved
I am trying to install the reticulate package on my Mac and it depends on the png package, which in turn depends on libpng. I installed libpng with brew but the png package fails due to a missing l...
Marcusmarcy asked 20/1, 2022 at 16:0
2
Solved
Is it possible to set the console font and font size, as I would with "Edit->GUI preferences", programmatically? What would a function for this look like? I am on windows.
Knott asked 5/2, 2013 at 16:38
6
Solved
I am trying to remove the seconds from a column of hours in POSIXct format:
#"2016-04-02 10:33:45 COT" "2016-04-02 22:19:24 COT"
#"2016-04-09 17:47:13 COT" "2016-04-13 16:56:23 COT"
x <- struc...
2
Solved
for example, test.R is a one line file:
$ cat test.R
# print('Hello, world!')
we can run this file by Rscript test.R or R CMD BATCH test.R. However, is it possible to instruct R to execute code...
Comfrey asked 21/3, 2017 at 14:22
2
Solved
This is question about R internals. How integer NA values are represented in R?
Unlike floating there is no magic bit sequence to represent NaNs.
# Create big array. newer versions of R won't allo...
Paste asked 8/6, 2019 at 15:34
3
Solved
I want to calculate growing degree days with several bases, using minimum daily temp, and maximum daily temp. I would like to do this without a for loop if possible to minimize my code.
bases <-...
2
Why does t(mat1) %*% mat2 work quicker than crossprod(mat1, mat2). Isn't the whole point of the latter that it calls a more efficient low-level routine?
r$> mat1 <- array(rnorm(100 * 600), di...
Jessejessee asked 3/10 at 5:24
3
Solved
Is there a smart way to have a horizontal border table wide when you have merged cells? (In the example below, it is not yet table wide).
Or should I write a function to calculate the correct inde...
3
Solved
I have a dataset in R that looks like this:
data = structure(list(quarter = c("Q1 2005", "Q2 2005", "Q3 2005", "Q4 2005",
"Q1 2006"), value = c(12...
Stalemate asked 3/10 at 21:46
3
Solved
Suppose there are many binary strings
x <- c("0100100010101010", "0100110010101010","0111001000","010111")
I am looking for a fast method in R to output...
Franciskus asked 2/10 at 7:5
2
There are some prior related questions (1, 2, 3), but nothing quite what I want, and I can't get the code example to work that Jenny Bryan posted in 2018.
I have a folder shared with me with some l...
Weevily asked 4/11, 2020 at 20:57
2
Solved
With gamma() in R you get output 24 from input 5.
How can I make inverse function which can get output 5 from input 24?
>gamma(5)
24
I found [invgamma] package, but I can’t understand if it is ...
Diffract asked 29/9 at 4:11
1
I'm building a r / plotly chart with multicategory x-axis. I found a way to define two x-axis categories with rbind(), but can't seem to find a way to rotate x-axis tick labels for both categories ...
4
Solved
I want to output a subset of a list of pathnames, conditional on characters in the list elements (prefix in the filename). I can get a for loop to work, but I want to do it using sapply because I'm...
Towne asked 27/9 at 15:18
5
Solved
I have a column in a dataset looking like this:
cluster_id
1
1
1
1
NA
1
NA
NA
2
NA
2
NA
3
NA
NA
3
cluster_id <- c("1","1","1","1","NA","1...
Hottempered asked 27/9 at 10:0
4
Using facet_grid(), how can I place the group names, i.e. the grey strips, on the top of the plots when graphing the plots stacked vertically in a single column?
From what I have tried, when stacki...
Pukka asked 13/6, 2020 at 6:9
1 Next >
© 2022 - 2024 — McMap. All rights reserved.