You were pretty close. I’m not sure what DFl
is though. But this works…
DF <- data.frame(A=c("a", "a", "a", "b", "b", "c"))
DF$A[duplicated(DF$A)] <- NA
> DF
A
1 a
2 <NA>
3 <NA>
4 b
5 <NA>
6 c
More Related Contents:
- How to make plots from distributed data from R
- Nested facets in ggplot2 spanning groups
- ggplot2: histogram with normal curve
- How to run R on a server without X11, and avoid broken dependencies
- How should I deal with “‘someFunction’ is not an exported object from ‘namespace:somePackage'” error? [closed]
- Remove quotes from a character vector in R
- Collapse rows with overlapping ranges
- Joining aggregated values back to the original data frame [duplicate]
- geom_boxplot with precomputed values
- How to avoid: read.table truncates numeric values beginning with 0
- R – converting date and time fields to POSIXct with HHMMSS format
- How to select last N observation from each group in dplyr dataframe?
- rvest Error in open.connection(x, “rb”) : Timeout was reached
- Automatically create formulas for all possible linear models
- Perform multiple paired t-tests based on groups/categories
- What is about the first column in R’s dataset mtcars?
- R – ggplot2 issues with date as character for x-axis
- Using If/Else on a data frame
- dplyr / R cumulative sum with reset
- ggplot2: Setting geom_bar baseline to 1 instead of zero
- Plot background colour in gradient
- How to load data quickly into R?
- Sum of two Columns of Data Frame with NA Values
- Extract the coefficients for the best tuning parameters of a glmnet model in caret
- R divide data into groups
- Convert all data frame character columns to factors
- Reading text file with multiple space as delimiter in R
- Dynamic linking with rpath not working under Ubuntu 17.10
- How to pass column name as argument to function for dplyr verbs?
- How to use data.table within functions and loops?