I'm looking for an efficient way to create a boolean vector which returns TRUE if one or more of a number of specified variables e.g. c(1,2,3) are in another ve
I want to produce this string: All my variables: a, b, c from this variable vars <- c("a", "b", "c") using glue(). My best attempt so far is: library(glu
I am trying to find out if certain patterns appear within a data frame. Suppose I have the following "dictionary of patterns" (notice "james" vs "jamesj"): patt
I need to make recodings to data sets of the following form. # List elements of varying length set.seed(12345) n = 1e3 m = sample(2:5, n, T) V = list() for(i
I have a "date" vector, that contains dates in mm/dd/yyyy format: head(Entered_Date,5) [1] 1/5/1998 1/5/1998 1/5/1998 1/5/1998 1/5/1998 I am trying to plot
I've been looking for a way to conduct group-based trajectory modeling in R with no avail. Something along the lines of what PROC TRAJ (http://www.andrew.cmu.e
I'm trying to create a leaflet map of census data. I have a csv file contains the number of deaths across Ireland. The data consists of the year($Year), the Sex
I not sure if this is a bug or not. If I encode one of the characters to UTF-8 before converting to raw and back again, then the characters are not the same. I
I'm recently working with data as year <- c('1990', '1990', '1994', '2000', '2012') n1 <- c(30, 70, 20, 31, 10) n2 <- c(40, 60, 20, 21, 8) r1 <- c(0
I have written a code in R which is supposed to retrieve certain information from a website and import it into an Excel file. I have used it for one website and
hello im trying to extract some id with a group and Date in range > d1 id group Date 1: 1 A 2017-07-02 2: 2 A 2017-07-04 3: 3 A
I have seen similar posts on this topic (see, for example, here and here) but not one that is specific to the sf-tidyverse ecosystem. I have a series of lakes,
I'm trying to merge to data frames like this: data1 <- data.frame(hola = as.numeric(), toma = as.character()) data2 <- data.frame(hola = as.numeric(1), t
I have a Shiny application that generates one image after clicking an action button, and saves the screenshot of that image after pressing on another action but
I am trying to reproduce the following functions created in Python in R. # Python def square_area(side): return side * side results = [] for i in range(1
Every time I restart R I issue the following command: setwd("C:/Users/avtarsingh/Downloads") How do make this my permanent working dir
I want to collect individual information (name and age) as user input with the attached demo code. The initial number of individuals is 1, and when the user inc
I've created two regression models using a linear panel model with plm, and a generalized panel model using poisson with the pglm package. library(plm); librar
I'm working with data that comes in a depreciated crs and want to avoid reprojection after converting the dataset to a SpatRaster. It seems that gdal is automat
df_final %>% mutate(Temp_Zones = cut(max_temp, c(0, 40, 60, 80, 100, 120))) %>% group_by(Temp_Zones) %>% summarize(X=n()) %>% save(df_f