[prev in list] [next in list] [prev in thread] [next in thread]
List: ess-help
Subject: [ESS] Help to get a code for recoding
From: mahfuz rahman via ESS-help <ess-help () r-project ! org>
Date: 2015-12-27 11:08:00
Message-ID: 74624059.3928864.1451214480118.JavaMail.yahoo () mail ! yahoo ! com
[Download RAW message or body]
Hi,Suppose I have following data file, the name of data file is A which is in CSV \
format.The first row represents the variable names. s e d v1 v2 v3 \
v4 v5 v6; 2 6 2 1 . . . . .
3 5 0 1 1 . . . 1
. . . 1 1 1 1 . 1
2 3 5 1 . . 1 1 1
Now I want to put 5 in the variables starting from s=2 and ending at e=6, e.i. \
starting from v2 to v6, if the variable d is greater than 1. But I want the columns s \
& e as the index of starting and ending of entry, I don't want the incorporation of \
any value directly, so that I can use this programme for a very large number of \
variables and cases, and for that the entry of 5 in the data file depends on the s \
and e variables. e.g. If s is 2 then the recoding should start from v2 and if e is 6 \
the recoding should end at v6. Now I want my new table looks like as follows: s e \
d v1 v2 v3 v4 v5 v6 2 6 2 1 5 5 5 5 \
5 3 5 0 1 1 1 1 1 \
1 1 1 2 3 5 1 5 5 1 1 1 Is it \
possible to get this data in CSV? It would be great if you send me the code for doing \
this. Thanks & RegardsMd. Mahfuzur RahmanDepartment of Population Science & Human \
Resource DevelopmentUniversity of Rajshahi Rajshahi-6025, Bangladesh [[alternative \
HTML version deleted]]
______________________________________________
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic