Issue I would like to know how to update the information of one column based on another column My example looks like df <- data.frame(input = c("Teline stenopetala", "Teline stenopetala", "Teline stenopetala", "Prunus lusitanica", "Prunus lusitanica"), n1 = c("Genista stenopetala
Continue readingTag: r
[SOLVED] replace double by single backslash
Issue I need to find a way to replace "\\" by "\" in a string using R. To be more specific, I have text data that is encoded as follows: text <- c("K\\xc3\\xb6nnen", "S\\xc3\\xbcd") I want to convert this to
Continue reading[SOLVED] modify columns for a list of data frames
Issue I have multiple tables loaded using lapply. The last colname is not the same for all tables which makes it impossible to rbind the tables. I would like to make a new column that contains the colname in column
Continue reading[SOLVED] How to split a dataframe into 2 by duplicated condition in R
Issue If I have a dataframe named df like so.. ____________________ | id | name | age | |____________________| | 0123 | Joe | 20 | |____________________| | 0123 | Kyle | 45 | |____________________| | 0333 | Susan |
Continue reading[SOLVED] How to generate a custom json from R dataframe using jsonlite package
Issue I have post this problem on the github homepage of jsonlite, no repsonse currently, https://github.com/jeroen/jsonlite/issues/390 Other package available to obtain the result? MWE: library(jsonlite) ifsxls <- structure(list(full = c("NATURE REVIEWS DRUG DISCOVERY", "LANCET" ), ab = c("NAT REV DRUG
Continue reading[SOLVED] Double clustered standard errors for panel data
Issue I have a panel data set in R (time and cross section) and would like to compute standard errors that are clustered by two dimensions, because my residuals are correlated both ways. Googling around I found http://thetarzan.wordpress.com/2011/06/11/clustered-standard-errors-in-r/ which provides
Continue reading[SOLVED] Counting number of days in months in r
Issue I have a dataframe with a column named date structured as bellow. Note that this is a small sample of my dataframe. I have different months and different years (my main date range is from 2005-01-03 to 2021-12-31). I
Continue reading[SOLVED] Random value in column in R
Issue Does anyone have an idea how to generate column of random values where only one random row is marked with number "1". All others should be "0". I need function for this in R code. Here is what i
Continue reading[SOLVED] How to apply a category to an output in R
Issue I’m trying to calculate a proportion of observed counts for a pearson’s chi square test. I have a data frame that has a column of categories ("x"), and a column of frequencies ("freq"), which I am going to divide
Continue reading[SOLVED] What would be the best practice to use JavaScript function in reactable?
Issue In reactable it is possible to use JavaScript functions, like in this example: reactable(iris, columns = list( Species = colDef( cell = JS("function(cellInfo) { return ‘<b>’ + cellInfo.value + ‘</b>’ }") ) )) However, all examples I saw in
Continue reading