[R] Need to insert various rows of data from a data frame after particular rows from another dataframe
Ranjeet Kumar Jha
r@njeetjh@||tkgp @end|ng |rom gm@||@com
Wed Jul 27 08:32:16 CEST 2022
Hi Calum,
Thanks for your reply !
Actually, I need to bring the 2018-2019 and 2019-2020 yield data
corresponding to each crop in every district under a state from the "Kharif
crop yield 18-19.xls" into "dacnet" file, given in the link. These two
years of data from Kharif file should be brought into dacnet file after
2017 or whichever latest previous year yield that crop contains for each
district in a particular state. Since Kharif file has different format and
11-12 crops with large number of districts in each state, I am unable to
get the data from Kharif to dacnet into same format. So basically, kharif
file yield data for 2018-2019 needs to be brought into dacnet file in the
same format as it is in dacnet file.
I hope it is clear now.
I will really appreciate your help!
Regards and Thanks,
On Wed, Jul 27, 2022 at 11:52 AM CALUM POLWART <polc1410 using gmail.com> wrote:
> Not very clear what you are trying to do. But I'd have thought possibly
> dplyr left_join might be a solution for you. The base R equivalent is
> merge().
>
> It might be a rbind or cbind can do it too.
>
> On Wed, 27 Jul 2022, 03:30 Ranjeet Kumar Jha, <ranjeetjhaiitkgp using gmail.com>
> wrote:
>
>> Hello Everyone,
>>
>> I have dataset in a particular format in "dacnet_yield_update till
>> 2019.xlsx" file, where I need to insert the data of rows 2018-2019 and
>> 2019-2020 for the districts those data are available in "Kharif crops
>> yield_18-19.xlsx". I need to insert these two rows of data belonging to
>> every district, if data is available in a later excel file, just after the
>> particular crop group data for the particular district.
>>
>> I have put the data file in the given link.
>>
>> https://drive.google.com/drive/u/0/folders/1dNmGTI8_c9PK1QqmfIjnpbyzuiCXgxFC
>>
>> Please help solving this problem.
>>
>> Regards and Thanks,
>> Ranjeet
>>
>> [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help using r-project.org 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.
>>
>
--
Ranjeet Kumar Jha, M.Tech. (IIT Kharagpur), Ph.D. (USA)
https://www.linkedin.com/in/ranjeet-kumar-jha-ph-d-usa-73a5aa56
-----------------------------------------------------------
Email: *ranjeetjhaiitkgp using gmail.com <ranjeetjhaiitkgp using gmail.com>*
*"Simple Heart, Humble Attitude and Surrender to Supreme Being make our
lives beautiful!"*
[[alternative HTML version deleted]]
More information about the R-help
mailing list