[R] Subsetting dataframe by the nearest values of a vector elements

Harun Rashid mhrashidbau at yahoo.com
Mon Nov 9 14:26:24 CET 2015


Hello,
I have a dataset with two columns 1. cross_section (range: 0~635), and 
2. elevation. The dataset has more than 100 rows. Now I want to make a 
subset on the condition that the 'cross_section' column will pick up the 
nearest cell from another vector (say 0, 50,100,150,200,.....,650).
How can I do this? I would really appreciate a solution.
Regards,
Harun
-- 

<mailto:mhrashidbau at yahoo.com>
<mailto:mhrashidbau at yahoo.com>

	[[alternative HTML version deleted]]



More information about the R-help mailing list