Skip to main content
8 votes
3 answers
1k views

I have a bug in one of my packages that I do not understand. I have an if() statement that checks for NA. In one case, the vector returned is NULL. Why is is.na(NULL) returning an empty logical vector ...
brunj7's user avatar
  • 336
2 votes
3 answers
115 views

I'm creating a stacked area plot showing phytoplankton biovolume over time, and I have one year of missing data. I'd like my plot to show the break in the data as it would using geom_line, but I can't ...
KT-'s user avatar
  • 23
4 votes
2 answers
161 views

I have the following data frame (example): myfile <- data.frame(C1=c(1,3,4,5), C2=c(5,4,6,7), C3=c(0,1,3,2), C1_A=c(NA,NA,1,2), ...
JohnPat's user avatar
  • 85
0 votes
1 answer
131 views

I want to develop a tmap::tmap_style() that includes several options, such as "yellow" for the fill color for missing values. I want to produce the following graphics: World <- tmap::...
petzi's user avatar
  • 1,645
2 votes
2 answers
86 views

I'm preparing to run Random Forest, but first I need to get my dataset in a form that would be functional for that. As such, I'm trying to fix a few problems with it. I have theoretical solutions, but ...
shrimp's user avatar
  • 101
0 votes
1 answer
159 views

I have written the following code in R which adds a date (dp_date) and creates a flag (dp_flag) in dt.all sample based on columns from data tables dt.all and Info. The issue that I cannot create ...
Bambeil's user avatar
  • 320
3 votes
4 answers
101 views

I want to create a new vector or a new object matching the number of unique id that are not associated with an age variable (missing data). Please find a MWE below. df <- data.frame(id=c('a', 'b', '...
CharlesLDN's user avatar
6 votes
6 answers
239 views

I have a dataset like this: tdf <- data.frame( A = c(1, 2, 5, 4), B = c(NA, 3, 4, 5), C = c(NA, NA, NA, NA), D = c(NA, NA, NA, NA), E = c(10, 20, 30, 40)) And I need to ...
Hard_Course's user avatar
4 votes
6 answers
186 views

I have a dataset with multiple columns and more than 60k rows. I am using na.approx() to replace NAs in each column. I would like to identify the rows which had NA and were replaced, something like &...
Mee's user avatar
  • 321
5 votes
1 answer
95 views

I am trying to calculate slopes for multiple measures in a grouped dataset using lm() in R. However, some groups have all NA values for certain measures, which causes the following error: Error in `...
Zaida's user avatar
  • 97
0 votes
2 answers
89 views

I'm not sure how else to describe this problem. I hope someone knows of this issue already. Reprex: t_fac <- factor(c("A", "A")) t_lev <- factor(c("B", "C"...
Marro's user avatar
  • 105
0 votes
3 answers
90 views

I combined two dataframes using two different shared ID columns ("name" and "idA"). One of the datasets had a third ID column that was retained ("idB"). Now I have one ...
mchuck's user avatar
  • 1
1 vote
1 answer
73 views

Problem: omit the NA values in a data.table random_dt. It can have NA values for any of entire row or column. Requirement: Display only those columns and rows which have non NA values including zeroes....
Mohit's user avatar
  • 575
2 votes
1 answer
170 views

Say I have a data frame like myiris below, where I want to just highlight the setosa species. I don't want, however, the other species to show in the legend. For my convenience, I just made all the ...
DaniCee's user avatar
  • 3,257
1 vote
1 answer
78 views

I am working with NSCH data for the first time in R. I found the following resource, which has been enormously helpful (thank you!). https://github.com/ajdamico/asdfree/blob/master/nsch.Rmd I followed ...
Blair Burnette's user avatar

15 30 50 per page
1
2 3 4 5
209