How do I change all occurrences of "Sí" into "Yes" in my data set?
data[data == 'Sí'] <- 'Yes'My code yields the error: Error in as.POSIXlt.character(x, tz, ...) : character string is not in a standard unambiguous format
View ArticleHow to get the largest column value from each row using dplyr [duplicate]
This question already has an answer here:For each row return the column name of the largest value 7 answersGiven the following data : df <- data.frame( a = c(1,2,3,5), b = c(7,9,52,4), c = c(53,...
View ArticleHow do I get units (NOT label) to be displayed on the X axis of a barplot?
I'm trying to create a data visualisation to show the number of schools broken down by the number of classes. I created a tibble that does this (I've pasted below) Where there are two columns,...
View ArticleChange order of subplots
Is there a way to change the order of subplots in plotly for R? Is there a way to manually change the levels of a factor in this code? I want a plot with Weight in the first plot followed by a,b,c in...
View ArticleProblem using the CRAN "gapminder" package
I tried downloading the R package "gapminder" but I am unable to use the data from the package. I think it's because I'm receiving these error messages in the console. Here is the code I...
View ArticleCan I test just one node of a decision tree?
I'm a novice at R so bare with me. I'm looking to test a single node of a classification decision tree. I put together a classification tree using rpart and I want to take one specific node, and...
View ArticleHow do I know when to use rev = "something other than neither" with the...
I'm learning R in a Bachelor course for the Biology bachelor and had to use the riskratio() function (from the epitools package) for the first time. I'm looking at an example script the teacher posted...
View ArticleHow to Clean Address Data in R or Excel?
I have a list of addresses that have unnecessary information. I would like to remove string between first , and second , including commas. for example: 527 TEST RD, APT 22, EDINBURG, TX I want to make...
View Articler Blastula Error in curl::curl_fetch_memory(url, handle = h) : MAIL failed: 530
NOOB question related to R blastula. I am trying to send an email with blastula using office365. I was able to create a credentials file but can't seem to send a simple test email:require(blastula) ;...
View ArticleHow do I change the font for all elements in ggsurvplot?
I've used the following code to plot Kaplan-Meier survival curves and the corresponding risk table. I'd like all elements of the plot and table to have font Arial size 12.library(survival)...
View ArticleCan't set up Market Data Api in Rstudio
This is a simple question, but one that I can't for the world figure out, After 10h of trying to set this Api up in R studio i got terrible stuck i seek aid in this complicated matter. Im trying to set...
View ArticleImputing NA with conditional LOCF
I'm stucked with a variation of a general problem. I have this situation, partially resolved by the code provided below.ID Ins Y 1 0 2010 1 NA 2011 1 1 2012 1 NA 2013 1 NA 2014 2 0 2011 2 0 2012 2 NA...
View ArticleAssign ID by matching conditions over different columns
Hi Guys I would like to assign an ID to the following dataframe. The Bus has to be the same if the arrival station matches departure station and if arrival time matches with the departure time. Does...
View ArticleHow to optimize this R script to use the minimum CPU and Memory possible
I built this R script that generate a map and a background tiles, the problem is, I need to run it on PowerBI service, which has a very constrained resources (Ram and CPU), I attached a reproducible...
View ArticleError in createDataPartition.... : y must have at least 2 data points
i need help with createDataPartition I am getting this errorError in createDataPartition(TBdta$medv, p = 0.8, list = FALSE) : y must have at least 2 data pointsmy codelibrary(tibble) dta <-...
View ArticleScrape a table in table at HTML using rvest
I tried to get price information from the site, but there is a table in the table and when I turn to "brendStella" I get only class and id. Any ideas how to get a table from...
View ArticleFilter rows based on a swapped combinations [duplicate]
This question already has an answer here:Unique rows, considering two columns, in R, without order 4 answersImagine I have a data frame with three columns were column 1 and 2 depicts unique combination...
View Articlewhat is the reason for this error in BRugs package of R
I am trying to use the BRugs package in R to do MCMC. I used it normally in windows, But when I used it the same way in linux, there is a same error message once I am running the function modelCheck,...
View ArticleNested ifelse with multiple OR conditions [closed]
I'm trying to write a nested ifelse statement which returns either a 1 or 0 based on sti history. The questionnaire scale is NA, None, 1, 2, 3-5, 6-9, 10-19, 20+. If the subject endorses ever having an...
View ArticleR and dplyr: how to use ifelse condition with an external dataframe
I'm using dplyr and spark to create a new variable with the mutate command. This new variable new_variable is categorical and must be ALFA if the value of the variable my_data_variable is inside a...
View Article