Questions tagged [r]
I can't seem to figure out how to combine these legends. Can anyone help? Here's a MWE data("iris") iris % mutate(smell = if_else(Species %in% "setosa","smells good", "does not smell good")) ggplot(iris, aes(x = Sepal.Length, y = Sepal.
Continue reading →i have a Rmarkdown document that contains a data frame and a plot in the same chunck. --- title: "Untitled" output: pdf_document date: "2024-04-23" --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) library(dplyr, warn
Continue reading →In R, there is Mclust, which would by default run the EM algorithm considering G=9 components. In Matlab, it seems that it only performs the EM algorithm for a single given number of components. Is there either: A function that is like
Continue reading →How do I know that wilcox_test (package statix) recognizes the correct column for each individual sample, when doing a paired test? Here is an example: install.packages("statix") install.packages("datarium") library(statix) library(datar
Continue reading →I am trying to plot the probability of detection vs number of surveys following an eradication attempt, to produce plots like the below: From the following publication: https://dspace.lib.hawaii.edu/server/api/core/bitstreams/d5c5c776-a
Continue reading →I need some help making a gpr model. I have data for 15 different stocks (Olje_Energi). This data contains price and the price change 1 and 3 months after the stock price reaches above the 50SMA, the close price and the 50SMA . I want to
Continue reading →I'm using the officer package to create a Word document with some tables in it. I want the tables to have simple lines separating cells, but I don't know how to do it. I add each table with body_add_table(), and I know there is a functio
Continue reading →My data is in a text file (data from different farms). I have many columns (about 100 columns) in this file. But for now I'm focusing on one of columns, this column represent locations (name of locations). I need to change this column, a
Continue reading →I am trying to create a water heat map (wtr.heat.map) using lake analyzer and I keep running into this error Error in r[i1] - r[-length(r):-(length(r) - lag + 1L)] : non-numeric argument to binary operator" I believe it's because I'm h
Continue reading →I'm not sure what is happening here but can anyone explain why this variable does not get correctly converted to a factor on the first iteration only? # a tibble datF
Continue reading →it will not read the titles d_df %>% + mutate ( Year = substr(Date, 7, 10)) %>% + mutate(Structures = ifelse(ID %in% tnnls, "tunnelS", "bridges")) %>% + filter( Year %in% yrs_wnt) %>% + group_by(Year, Structures) %>% + sum
Continue reading →In the below string, I only want to extract the value that matches "Left" and "Right", and excludes the rest using mutate(). Let's pretend I have a dataset data with a column called string. library(tidyverse) data$string
Continue reading →Hello i am new to R programming and i am stuck with one problem. I would like to combine 2 dataframe into a new one in this way. First column of first dataframe, first column of second dataframe and then the third column of the new dataf
Continue reading →I am trying to add a list of points to my boxplots, however, the points only show up for one boxplot and not for the another. I was wondering if anyone could help me identify the problem. Here is the code I am using. #graphics.off() rm
Continue reading →I would like to unnest() a data frame where NULL values are stored as list(). How can I do it? library(dplyr) library(tidyr) df # A tibble: 2 x 2 #> date id #> #> 1 1 #> 2 140 unnest(df, date) #> Error in
Continue reading →I have a dataframe similar to this: data % formatStyle( columns = c("Rider1", "Rider2", "Rider3", "Rider4"), valueColumns = "Rider", backgroundColor = styleEqual(data$Rider, c("Rider1" = "yellow", "Rider2" = "lightblue", "R
Continue reading →I'm guilty of newbieness. Help. I'vs downloaded data from Google Maps (personalized maps) in KML format and was expecting to transform it into some clean looking table. Boy was I wrong! KML reading functions only were only able to read 5
Continue reading →I created two Lists: List1 and List2. The elements of the lists are dataframes and using each 'n' element of the lists i create a plot: fff= List1[[x]] %>% gather(key, value, tmp117_corr, bme280_temp_corr) %>% ggplot(., aes(Time))
Continue reading →I'm building a shiny app to connect to big query and return info on projects, datasets and tables in a big query account. I'm also using the bigrquery package and would like to know how to force it to ask for authentication. Right now, o
Continue reading →In R, the term "empty list" is usually understood to mean list(). But this isn't what you get when you delete all the elements from a named list: x = list(a = 1) x$a = NULL print(x) # named list() print(identical(x, l
Continue reading →