Re: [R] Converting a Date variable from character to Date

2022-09-29 Thread Admire Tarisirayi Chirume
5 2022-06-01 > ## 7 2022m7 12673 2022-07-01 > ## 8 2022m8 14356 2022-08-01 > ## 9 2022m9 14708 2022-09-01 > > > > Thanks > > Jim Holtman > *Data Munger Guru* > > > *What is the problem that you are trying to solve?Tell me what you want to > do,

[R] Converting a Date variable from character to Date

2022-09-29 Thread Admire Tarisirayi Chirume
usion in the email. > > On September 29, 2022 8:52:30 AM PDT, Admire Tarisirayi Chirume < > atchir...@gmail.com> wrote: > >I kindly request for assistance to convert a Date variable from a > character > >to be recognised as a date. I used the following command lines. >

[R] Covwerting a Date variable from character to Date

2022-09-29 Thread Admire Tarisirayi Chirume
I kindly request for assistance to convert a Date variable from a character to be recognised as a date. I used the following command lines. inflation<-read.csv("Inflation_forecasts_1.csv") attach(inflation) inflation[,1:2 ] #subsetting the dataframe #Renaming variables inflation<- rename(inflation

[R] Converting Character date to Dates in r

2022-09-28 Thread Admire Tarisirayi Chirume
Hello, i hope this email finds you well. Kindly help me to format dates shown as character to dates using as.Dates. Attached herewith is my data in excel csv format. The following is the r-code i have used in my analysis: setwd("Z:/2022/September/Inflation forecasts") inflation<-read.csv("Infl

[R] Replacing NA s with the average

2021-10-18 Thread Admire Tarisirayi Chirume
Good day colleagues. Below is a csv file attached which i am using in my > analysis. > > > > household.id > > hd17.perm > > hd17employ > > health.exp > > total.food.exp > > total.nfood.exp > > 1 > > 2 > > yes > > 1654 > > 23654 > > 23655 > > 2 > > 2 > > yes > > NA > > NA > > 65984 >

[R] creating a new variable and merging it on the dataframe

2021-10-18 Thread Admire Tarisirayi Chirume
Good day colleagues. Below is a csv file attached which i am using in my analysis. hh.id hd17.perm hd17employ health.exp total.food.exp total.nfood.exp 1 2 yes 1654 23654 23655 2 2 yes 2564 265897 65984 3 6 no 2547 123311 52416 4 8 no 5698 13648 12544 5 6 no 1254

Re: [R] Long Format data

2021-08-05 Thread Admire Tarisirayi Chirume
; ATClong$year<-as.numeric(substr(ATClong$year,2,5)) > # check the first row > ATClong[1,] > > As the "Variables" column is messy, you may want to substitute the > numeric value in the long output and print a table of the numeric and > character values of the factor: > >

[R] Long Format data

2021-08-03 Thread Admire Tarisirayi Chirume
Hello, i hope you are well. May you kindly help me to structure data in the folder attached herewith in file BOP_All_Countries.csv. I am doing panel data analysis. *I need it to be structured as it is on the file R_help.csv. * Please kindly see the r-script below *(r_help.R)* that i ran which did

[R] Wide to long format in R

2021-05-17 Thread Admire Tarisirayi Chirume
I need help on reshaping my data frame which is currently in wide format. I ran the following codes to create panel ids based on the variable for country names "*Country"; * *bop.df$id<-as.numeric(as.factor(bop.df$Country))* then ran the code below to reshape from wide to long format; *reshape

[R] Filtering a dataframe

2021-05-17 Thread Admire Tarisirayi Chirume
Can someone help on how to filter my data frame below such that it retains a country if a given id (last column) is satisfied eg filtering a data frame that has countries with id 1 and 2 only Country year bank_ratio Reserve_ratio broad_money id Angola 2006 24 77 163 1 Angola 2007 25 59 188 1 Botsw