Showing posts with the label r

[FIXED] SQL query result is not showing in R odbc

Issue I am trying to run a simple query using R which is listed below. I am connected to odbc and i…

[FIXED] Retrieve a specific DB project and its tables from SQL Server in R

Issue I am new to using SQL Server from RStudio. I am connected to SQL Server from RStudio and the …

[FIXED] how to make the y-axis value in order when using ggplot2 in R language

Issue I was trying to use ggplot2 to plot multiple lines in a window. this is my code here: ggplot…

[FIXED] Replacing values in a R dataframe given certain conditions

Issue I'm trying to loop through columns 10 - 12 of the following data set df2, replacing 1 wit…

[FIXED] R notation for declaring vectors - Axioms of Probability

Issue We have this homework assignment. Problem 1: Suppose we are interested in the buying habits …

[FIXED] Create a sequence before an indicator variable

Issue I'm looking to do hazard analysis but before I do that I want to clean my dataset so I ha…

[FIXED] How do I overwrite values I select from a dataframe?

Issue For examples this does not work: mtcars %>% filter(cyl == 8) %>% select(mpg) <- 1 …

[FIXED] Plotly grouped barchart : how to create buttons to display different x values R

Issue this is my dataframe : artists <- c("Black Waitress", "Black Pumas") …

[FIXED] Read multiple files into DuckDB in R from CSV, with new variable indicating year from filename

Issue I have several (8) large files (1M rows each) with the same variables/format saved individual…

[FIXED] Optimizing correlation calculation between (biological) replicates in R

Issue I have a dataframe with following structure: df <- data.frame( Replicate = c(rep(&…

[FIXED] The simplest way to convert a list with various length vectors to a data.frame in R

Issue Here I have a list with different length vectors. And I'd want to get a data.frame. I'…

[FIXED] How to calculate difference in values grouped by 2 separate variables in R

Issue Let's say we have a team variable, but we also have a time period 1 and a time period 2 v…

[FIXED] How to group individual values from an existing variable into a new variable in R

Issue I'm new to R and I'm stuck. I'm working on a health dataset with each row as one …

[FIXED] Remove special characters from entire dataframe in R

Issue Question: How can you use R to remove all special characters from a dataframe, quickly and…

[FIXED] What is the difference between metric and non-metric MDS for a beginner?

Issue I am fairly new to data science and would like to know in simple words (like teaching your gr…

[FIXED] Computation of average of a column on rolling in R data.table

Issue library(data.table) DT <- data.table( N = 1:16, x = c(11,11,11,11,11,11,11,11,21,2…