Category "r"

Addition corresponding to all possible combination of two columns based on a criteria

I have the following input | ID | Column1 | Column2 | Value | |:-- |:-------:|:-------:| -----:| | A | x | a | 4 | | A | x | b |

Error in dataprep function of Synth package - treated unit not found in unit.variable

I'm using the Synth package to evaluate the effect of a policy - Synthetic Control. However, when using the dataprep function in R it gives an error: Error in

Time series Forecasting with Daily values

I am doing forecasting with auto.Arima with uni-variate data but my forecast is not correct. I have used all the steps correctly but the point forecast value is

Analysing vocal similarity of little owls using warbleR in R

I am struggling a bit with an analysis I need to do. I have collected data consisting of little owl calls that were recorded along transects. I want to analyse

Analysing vocal similarity of little owls using warbleR in R

I am struggling a bit with an analysis I need to do. I have collected data consisting of little owl calls that were recorded along transects. I want to analyse

How to run kmeans and dbscan in r using all processing and memory of linux ubutum 20.04 server (mapply, applay, parApply, etc)?

I have access to a linux server with the following configuration: I have this one matrix with gamma distirbution range[0:12000] ,Col=30000 and Row=8000. In thi

Solution For Side By Side Bar Graph Error: can only have an x or y aesthetic [duplicate]

I was having trouble making a side-by-side bar graph with a column containing characters (ride_month), a column containing the total numeric d

Stacked barchart with 3 variables

I have a survey data with respondents answering multiple questions. In one variable, respondents express their opinion about a party "1" = favorable and "0" = u

R Shiny dataTableOutput - prevent column from showing full text column

I have code to present a table in my R Shiny application. There is a character column where the value within a given cell can be a large number of characters. I

How adjust code functionality to specifications using data.table function

I would like to change the approach to generating Output. Is it possible to use the data.table function for this case below? If yes, could you help me adjust? I

Bind spatial data frames

I have a long panel dataset (Data_Base) with the name of the 32 states in Mexico through 28 years in time (928 obs). I have in another .rds file the spatial dat

Extract Month and Day from Date in R

Is there a way to extract month and day from Date as shown below > asd <- data.frame(a = c('2020-02-15', '2020-03-16')) > asd a 1 2020-02-15

Find matching phrases of at least 5 words or longer between two texts in R

I have two vectors of text that I want to compare to identify any phrases that are at least 5 words long that are common between the two. Some example text with

How can I load an xlsx workbook into R?

I have an xlsx workbook on my desktop with existing sheets. I have a dataframe in R that I would like to add to this workbook as a new sheet. Using library(open

permanova betadisper: missing observations due to 'group' removed Error in eigen(-x/2, symmetric = TRUE) : 0 x 0 matrix

I tried to adapt a code from an earlier version of R to process some data. I got most of it working again but ran into an issue.... I am trying to use vegan to

How to define the difference between id's nodes of graph?

I have a graph g n = 8 m <- t(matrix(c( 0,0,0,0,0,0,0,8, 3,0,0,0,0,0,0,0, 5,0,0,5,1,0,0,0, 0,0,6,0,0,7,1,0, 0,6,2,0,0,0,0,0, 0,0,0,0,0,0,0,0, 7,4,0,0,8,0,0,3

How to create a series of neural networks using neuralnet in R?

I would like to change this: library(neuralnet) nn1 <- neuralnet(Species == "setosa" ~ Petal.Length + Petal.Width, iris, linear.output = FALSE) nn1 <- neu

Add an opacity slider to a leaflet map generated in r

I would like to add an opacity slider to a leaflet map generated in r. It should change the opacity of the uppermost visible or all visible layers (either of th

How add a row of 0 to a dataframe

I have this dataframe in R mat <-structure(list(a = c(2, 5, 90, 77, 56), b = c(45, 78, 98, 55, 63), c = c(77, 85, 3, 22, 4), d = c(52, 68, 4, 25, 79), e = c

How do I make a more concise extraction from a character vector in R?

We use google calendar for reservations of several machines, and I am making graphs of the usage. I have a line to extract the titles of the calendars for plot