509,921
questions
1
vote
0
answers
7
views
Finding Mean of Y_Var user input in Shiny using Plotly
I am hitting a roadblock in trying to find the mean value of the Y Axis of user input in plotly. I am making a shiny app and I need to be able to allow users to select different combinations of ...
0
votes
0
answers
9
views
R ndtv package, render.d3movie() function, displayed vertex label does not match with vertex_id
Example data: https://drive.google.com/file/d/1Tn4-jm1XlYocdoVdEZSM1s5d0Iz65DNF/view?usp=sharing
library("ndtv")
example = read.table(
file = "~/m_pr_tr_x24_ts_sam.dat",
sep = ...
1
vote
0
answers
11
views
New column in R data table via function that looks up in other data table
I have a data.table and want to add a new column:
big_table[, ("new_column") := some_function( col1, col2, … ) ]
The function may be defined as
some_function <- function( xCol1, xCol2, … ...
0
votes
0
answers
11
views
Error when R package rredlist cannot find a species
This code allows me to get the IUCN status of a species of bird:
remotes::install_github("ropensci/rredlist")
library("rredlist")
c("Branta") -> genus
c("...
3
votes
0
answers
43
views
Making sure that colors are properly placed in graphs
I wrote this code which tries to make colorful patterns on a square grid such that for a given color, all squares of that color can reach all other squares of that color without stepping on any other ...
0
votes
0
answers
23
views
Incorrect z-values in plotly
I want to plot a surface $f(x,y) = x^2+2x-y$ and its tangent plane at point $(0,3,-3)$ but the code does not give the correct plot.
library(plotly)
x <- seq(from = -3, to = 3, length.out = 100)
y &...
0
votes
0
answers
24
views
Calculating dimension overlaps in multiplex network in R [closed]
I want to create a Venn diagram showing which ties are exclusive to an each network dimension and which are shared with others (similar to the attached one).
Hope you can help me with my question :)
...
0
votes
2
answers
38
views
Issues using match to replace values - "Can't use NA as column index in a tibble for assignment"
I have a dataframe of with a column of NA's. I need to replace these NAs with the values from another table. This is a relatively straightforward problem and has been addressed here: Replace NAs in ...
0
votes
0
answers
25
views
Code-Fold Only Select Blocks using Quarto
I'd like to prompt Quarto (HTML output) to fold some code blocks but not others with the initial output. So far, I've been able to get all code blocks to fold using code-fold: true.
Is there a way to ...
0
votes
1
answer
18
views
How to adjust text labels and color gradient in ggplotly stacked bar-chart?
When I convert my ggplot stacked bar chart to ggplotly, there are two issues that I can't solve:
the text labels at the end of the bars change position unexpectedly. I would like them to keep their ...
0
votes
1
answer
28
views
How to place on a caption on a code-generated figure in Markdown [duplicate]
The answers I have seen for figure captions assume you're inserting an image file. In my case I'm generating a plot with code and would like to be able to put a caption on it.
I'm working in R Studio ...
4
votes
3
answers
54
views
How to append the name of a sublist vector as a named element within the vector
I have a list that contains web-traffic details.
In the process of rectangling the lists, I'd like to append a value to each vector in the named sublists which is the actual name of the sublist vector....
0
votes
0
answers
44
views
Poisson distribution calculation [closed]
As I am learning R now, I received a task to calculate the Poisson distribution for a list consisting of the number of people taking out loans at a particular day at a bank branch (list of values 4,3,...
0
votes
0
answers
20
views
Giving data.table results in categories with more complication equations [closed]
I want to use R to calculate the poverty gap for 3 regions in a country. How do I code so that the poverty gap is divided only by the population of each respective area rather than the population as a ...
0
votes
1
answer
18
views
Maxent Variable Selection R Package
I'm currently using the Maxent Variable Selection package in R, but I'm encountering an error:
Error in file(file, "rt"): cannot open the connection
Additionally: Warning message:
In file(...