Fill in empty spaces modified

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fill in empty spaces modified

Ek Esawi
Thank you so much Jim. I forgot to state that i was hoping to get it
without loops if possible.

Thanks again,

EK

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fill in empty spaces modified

David Winsemius

> On Aug 9, 2017, at 3:39 PM, Ek Esawi <[hidden email]> wrote:
>
> Thank you so much Jim. I forgot to state that i was hoping to get it
> without loops if possible.
>

> library(zoo)

> is.na(eedf$nam) <- eedf$nam == ""
> eedf$nam <- na.locf(eedf$nam)
> eedf
    nam val
1 mandy   1
2 mandy   2
3  John   3
4  John   4
5  John   5
6  John   6
7  Zara   7
8  Zara   8

> Thanks again,
>
> EK
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA

'Any technology distinguishable from magic is insufficiently advanced.'   -Gehm's Corollary to Clarke's Third Law

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Loading...