How to work around NAs introduced by coercion in R?
participated in the review for their constructive contributions, and to the international organizations. He urged them to continue to show solidarity with C™te dÕIvoire. In closing, he said that, more...
View Articlehow to parse a text file that contains the column names at the beginning of...
My text file looks like the following" file1 cols= col1 col2 # this is a comment col3 data a,b,c d,e,f "As you can see, the data only starts after the data tag and the rows before that essentially tell...
View ArticleDplyr applying a calculation on values in a grouping comparing each item to...
I want to work out whether a value in a grouping is different enough from other values in a grouping. Specifically I want to work out whether an end time of a matches with the start time of another...
View ArticleForcing a 1e3 instead of 1000 format in ggplot R
I'm having some trouble with the y formatting ranges. When I use scale_y_log10() in my plot, it decides that having the scale 0.1, 10, 1000 is the way to do it. I really need it to display it as 1e-1,...
View ArticleSetting legend corresponding to end values of graph
I would like to adjust my legend (ggplot2) in such a way that the upper value in the legend corresponds to the highest end value. For example:Blue line ends on a value of 200, which is the highest, i...
View ArticleHow to loop over several models for survival analysis in R?
I have about 10 different models with different combination of features that I would like to test using survival analysis. I have tried the following but it doesn't workmodel1 = A1+A2+A3 model2 =...
View ArticleInterpolate missing values in a time-series and create a time-series model...
I have a dataset with 18 variables and 30k+ observations, with data being collected from sensors every 15min. Some of the variables collect the temperature and these will be used as independent...
View ArticleAvoid datatable greying out when recalculating
I have a very simple Shiny app to show the CPU usage and available memory of the shiny server : ui <- fluidPage( titlePanel('Shiny Server Monitor'), DT::dataTableOutput("cpu") ) server <-...
View ArticleFavicon in Shiny
I wanted to add a favicon to my WebAppI'm using this line, but it doesn't work:HTML("<link rel=\"icon\" type=\"image/png\" href=\"image.png\" />") inside the ui.R script and outside the shinyUI()...
View ArticleCan faceted counts be accessed by the stat()-function?
As in the title. I know I can calculate in-group percentages by calculating them prior to plotting, so if I write:fulldata %>% as_tibble() %>% group_by(gymnasiegrov, totstatus_tri) %>%...
View ArticleR SPARQL Wikidata: "Opening and ending tag mismatch"
My aim is to query wikidata using R. I just realized that the "Wikidata Query Service" offers code examples in order to so: 1. Go to https://w.wiki/AkK 2. Execute query 3. Click on Code next to the...
View ArticleProcessing netcdf file in R with multiple variables
EDITI have edited my question since I made some progress. I am trying to process the berkely earth data which is present in this website. http://berkeleyearth.org/data/. To get a sample data:Scroll...
View Article(Optim) Error: (list) object cannot be coerced to type 'double'
In a larger optimization task, i'm stuck at a point where I need to input a list into optim. However, when within the list there is a vector, I get an error(list) object cannot be coerced to type...
View ArticleInstalling RSelenium from GitHub
I want to use RSelenium for R, but it has been removed from CRAN. I decided to follow the guides using a download/installation from GitHub but I get an error message that I cant...
View ArticleFilter R data set by value but keep rows that come from the same record number
I have survey results that is organized so that each row is one survey question. That means that one person's survey response might take up 8 rows. I want to keep all of the responses for people who...
View ArticlePivot data from wide to long using column suffix to get table with multiple...
I have a tibble/dataframe that looks like this:hc_inpatient_sum hc_ambulant_sum hc_inpatient_mean hc_ambulant_mean 5 2 5.5 2.2 My desired output is:my_names sum mean hc_inpatient 5 5.5 hc_ambulant 2...
View ArticleR - Loop to import trimestral survey data to a single data frame to see...
I'm new to R programming. I have a function that imports trimestral data on a survey from a website to work with in R. The function from the package eph is as follows: get_microdata(year = 2019,...
View Articlepopulate new columns using formulas of previous column
I have a data frame of 2 columns (stage, year2000) and 6 rows as shown. stage (A,B,C,D,E,F), year2000 (100, 120, 90, 80, 70, NA)I added a new column "year2001" using the R codes below:data$year2001...
View ArticleIn R, how can I replace the values in one column with the values of another...
I'm working on automating a report in R. One thing we do is look at clients who enter a shop and estimate their age record that as Estimate Age. We are instructed to use the Estimated Age as Age in the...
View ArticleMapping in R-Studio
I am trying to create a pH map on R, but once I did the summary of the prediction model, it gives :NULL for class and mode. Which results in my raster not showing the pH variability. It appears as I...
View Article