I am a beginner user of R , I have a big CVS file that contain weekly and daily information and I want to read it one time then store the file into small files ( windows ) to deal with them separately.
the original file is a data frame which has Week (integer) and Day (char from Mon to Fri) and other attributes.
as I said I want to store the file into : W1,W2,W3,.....Wn ( the number of weeks depends on the information and I di not now it in advance,but it is between 10-11) moreover I want to store each day information D1,D2,D3,D4,D5
I tried the following code but it did not work as I was expecting.
myclasses = read.csv("C:/myfile.csv")
i=1
weekdays <- list('Monday','Tuesday','Wednesday','Thursday','Friday')
for (i <= myclasses$Week_number)
{
tmp1 <- paste("W", i, sep = "")
assign(tmp1, myclasses %>% filter(Week_number == i))
j = 'Monday'
for (j in weekdays)
{
tmp2 <- paste("D", j, sep = "")
assign(tmp2, myclasses %>% filter(Week_number == i,Day == j ))
}
i = (i +1)
}
also I tried for loop , but it led to create a high number of files. just to be clear I want to deal with days windows until create one week window , then the second week's days until create the second week window and so on.
could you help me with that please?