Category "r"

How to set the width of an error message in R?

I know you can set the width of your R output > options(width = 20) > 1:30 [1] 1 2 3 4 5 [6] 6 7 8 9 10 [11] 11 12 13 14 15 [16] 16 17 18 19 20

Parsing rvest output from an unstructured infobox

I am attempted to extract data from a wiki fandom website using the rvest package in R. However, I am running into several issues because the infobox is not str

Writing mid/mif files in R

I need to write vector files in mif/mid format in R. If I use: st_write(st_as_sf(vector_name), dsn = "Vector_Name", driver = "MapInfo File") it writes files in

Removing from tabsetpanel a panel defined inside a module (need to try twice to recreate a removed tab)

Im trying to build a simple app with a tabsetPanel having a set of panels definded inside a module, each one of these panels has an actionbutton aimed to remove

Calculating Highest In, First Out on trades

I am trying to use the Highest In, First Out accounting method on trades. Highest In, First Out means that when you sell, you sell your most expensive shares fi

Change factor level in map in R

I know this question has been asked before and I have seen answers in literature too. Still, I cannot get the code to work for my specific purpose and I hope so

How to replicate a function for a nested list

I have a nested list (datalist) which I'd like to repeat the following function for. Within datalist are multiple dataframes (e.g., A-F). After doing the follow

Rmarkdown document not rendering properly in Shiny App

I have a parametrized rmarkdown document based on Shiny inputs. The rmarkdown pdf renders properly when the app runs locally. However when hosted on the shiny s

R: Copying value for one type of group and year downwards and upwards

I created a simplified version of my data since my actual data is too large to be include here. structure(list(Name = c("A", "A", "A", "A", "B", "B", "B", "B",

I get an error when I try to run t.test()

I am trying to perform a t.test as follows: t.test(data = a, score ~ group, paired = T) However, I get this error: Error in complete.cases(x, y) : not all arg

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