皇冠hg0088代理网址

Questions tagged [r]

R is a free, open-source programming language and software environment for statistical computing, bioinformatics, visualization, and general computing. Please provide minimal and reproducible example(s) along with the desired output. Use `dput()` for data and specify all non-base packages with `library()` calls. Do not embed pictures for data or code, use indented code blocks instead. For statistics related questions, use http://stats.stackexchange.com.

Filter by
Sorted by
Tagged with
0
votes
0answers
4 views

Having error “Computation failed in `stat_boxplot()`: missing value where TRUE/FALSE needed” while using geom_box(coef=Inf)

Prior to the ggplot(df, aes(x = mass, y = method))+geom_box(coef=Inf) I use filter()%>%drop_na(mass)%>%mutate() where mass is mapped to the x aes. Then I'm getting this error "Computation ...
0
votes
0answers
7 views

Minimization of function under constraints in R

I have a function "f" as follows: f <- function (X){ DD= 91.8372-10.3096*(as.numeric((X[1]<70.5)&(X[2]>69.5)&(X[2]<79.5)&(X[3]>37.5))) +5.3719*(as....
0
votes
0answers
11 views

identifying unique values of a grouped variable [duplicate]

I am trying to count the # of unique date values across multiple visits. Here is sample data: id date 1 2017-08-31 1 2017-08-31 1 2017-05-06 2 2015-09-01 2 2015-11-01 3 ...
2
votes
1answer
12 views

Adding adjustable random noise to a matrix in R

I have a matrix generating function that produces lower-triangle of 1s and upper-triangle of 0s. I was wondering if it might be possible to add some adjustable random noise (from some distribution ...
0
votes
1answer
10 views

Get the maximum of the positions that are symmetric diagonally

I have a matrix like list1.I want to get the maximum at the two positions that are symmetric diagonally, and get the new matrix(list2).How can I run R or Excel? list1 A B C D A 11 9 11 ...
0
votes
0answers
7 views

Displaying multiple bar graphs in R from one data frame OR multiple dataframes

I have multiple dataframes for each type of ice cream. Each data frame says whether or not someone purchased that type of ice cream (column 1) YES or NO, and how many people chose Yes or No (column 2)....
0
votes
0answers
7 views

How to perform post hoc test (pairwise compaison) of model by betabin in aod?

Because of overdispersion, I try to use beta-binomial method fit the data. However, it seems emmeans and glht did not support the model by betabin. I test by the example data orob2 in aod, and want to ...
0
votes
1answer
21 views

Matrix with the bottom triangle of only `1`s and top triangle of only `0`s in R

I was wondering if there is a way to generate matrices with any requested number of rows and columns such that the bottom triangle is only 1s and top triangle is only 0s. An example of the expected ...
0
votes
0answers
10 views

how to separate a column by levels [duplicate]

This may be a very daft question but I have been trying to achieve it and have not yet succeeded. I have a dataframe that looks like this: df <- data.frame(Participant = c("PAH12", "...
0
votes
1answer
24 views

renaming multiple columns of vectors in data frame without typing all names

Instead of typing c("Col1","Col2","Col3", "Col4", "Col5", "Col6", "Col7", "Col8", "Col9", "Col10"), ...
0
votes
0answers
13 views

Change dataframe in Shiny App based on Reactable checkboxes

This demo R script has two data frames, that are displayed by two Reactable tables. When the number of checkboxes in the Iris table exceeds 2, the warning message in the msg table should change. Here ...
0
votes
0answers
5 views

How to share Database connection pool between shiny apps under ShinyProxy

In my practice, many shiny apps needs to access Postgresql DB which installed on host. I use pool package to get connection pool of Postgresql, and set it to global variable shared for other apps. But ...
0
votes
0answers
22 views

Get average of previous n games in R by filtering database [duplicate]

I have a data frame of sports games and want to get the average of the previous n points. For example, my data frame looks like this: Home Away Home Away Team Team Points Points 1 ...
0
votes
0answers
8 views

Error in py_call_impl(callable, dots$args, dots$keywords) ImportError: Could not import PIL.Image. The use of `array_to_img` requires PIL

Trying to use R to build a deep learning GAN, unlike other similar issues are from Python, mines are from Rstudio, I had everything figured out for installing different environments, packages in R, ...
0
votes
1answer
26 views

How to calculate the pre and post values ​each time an event appears on a dataframe in R

I have a database like this example here, and I need to calculate the average, the sum and the standard deviation of the 10 minutes prior to the event and also of the 10 minutes from the event. The ...

15 30 50 per page
1
2 3 4 5
24409