Updating running list if event happens
sample Data:
clear
* Input data
input student CITATION EXPELLED hadCITATION hadEXPELLED
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
2 0 0 0 0
2 0 0 0 0
2 1 0 1 0
2 1 0 1 0
2 0 0 1 0
3 1 0 1 0
3 0 1 1 1
3 1 1 1 1
3 1 0 1 1
3 1 0 1 1
4 . . . .
4 . 0 . 0
4 0 0 0 0
4 0 1 0 1
4 1 0 1 0
I want to create these hadCITATION and hadEXPELLED variable columns that update based on the responses of CITATION and EXPELLED.
count stata repeat
|
show 1 more comment
sample Data:
clear
* Input data
input student CITATION EXPELLED hadCITATION hadEXPELLED
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
2 0 0 0 0
2 0 0 0 0
2 1 0 1 0
2 1 0 1 0
2 0 0 1 0
3 1 0 1 0
3 0 1 1 1
3 1 1 1 1
3 1 0 1 1
3 1 0 1 1
4 . . . .
4 . 0 . 0
4 0 0 0 0
4 0 1 0 1
4 1 0 1 0
I want to create these hadCITATION and hadEXPELLED variable columns that update based on the responses of CITATION and EXPELLED.
count stata repeat
What do you mean?
– Pearly Spencer
Nov 15 '18 at 16:28
@Pearly Spencer. Student 2 does not have any CITATION or EXPULSION in there first response so the HAD variables are both 0. This is also true for student 2 second response so the HAD variables are both 0 still. Then at student 2 thirds response they have a citation so hereafter the hadCITATION variable equals to 1 for that student
– bvowe
Nov 15 '18 at 16:32
1
I don't find this clear either. You should certainly fold your comment back into the question. Also, please be more careful with spelling, punctuation, etc.
– Nick Cox
Nov 15 '18 at 17:07
1
You're more or less permanently at odds with recommendations, in that SO isn't really about us writing code for you. You are expected, at least by me, to show us your code attempt and also explain why it is still problematic.
– Nick Cox
Nov 15 '18 at 17:11
1
I am mostly in agreement with @Pearly Spencer and specifically downvoting for lack of clarity. The key point is that SO is not just a vehicle to provide code for an individual. You're expected to make your question clear and answer secondary questions. The simple and crucial ideal is that the thread should be helpful to other users in the future, and more than a way for someone to get one-to-one help in public.
– Nick Cox
Nov 15 '18 at 17:46
|
show 1 more comment
sample Data:
clear
* Input data
input student CITATION EXPELLED hadCITATION hadEXPELLED
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
2 0 0 0 0
2 0 0 0 0
2 1 0 1 0
2 1 0 1 0
2 0 0 1 0
3 1 0 1 0
3 0 1 1 1
3 1 1 1 1
3 1 0 1 1
3 1 0 1 1
4 . . . .
4 . 0 . 0
4 0 0 0 0
4 0 1 0 1
4 1 0 1 0
I want to create these hadCITATION and hadEXPELLED variable columns that update based on the responses of CITATION and EXPELLED.
count stata repeat
sample Data:
clear
* Input data
input student CITATION EXPELLED hadCITATION hadEXPELLED
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
2 0 0 0 0
2 0 0 0 0
2 1 0 1 0
2 1 0 1 0
2 0 0 1 0
3 1 0 1 0
3 0 1 1 1
3 1 1 1 1
3 1 0 1 1
3 1 0 1 1
4 . . . .
4 . 0 . 0
4 0 0 0 0
4 0 1 0 1
4 1 0 1 0
I want to create these hadCITATION and hadEXPELLED variable columns that update based on the responses of CITATION and EXPELLED.
count stata repeat
count stata repeat
asked Nov 15 '18 at 16:25
bvowebvowe
35118
35118
What do you mean?
– Pearly Spencer
Nov 15 '18 at 16:28
@Pearly Spencer. Student 2 does not have any CITATION or EXPULSION in there first response so the HAD variables are both 0. This is also true for student 2 second response so the HAD variables are both 0 still. Then at student 2 thirds response they have a citation so hereafter the hadCITATION variable equals to 1 for that student
– bvowe
Nov 15 '18 at 16:32
1
I don't find this clear either. You should certainly fold your comment back into the question. Also, please be more careful with spelling, punctuation, etc.
– Nick Cox
Nov 15 '18 at 17:07
1
You're more or less permanently at odds with recommendations, in that SO isn't really about us writing code for you. You are expected, at least by me, to show us your code attempt and also explain why it is still problematic.
– Nick Cox
Nov 15 '18 at 17:11
1
I am mostly in agreement with @Pearly Spencer and specifically downvoting for lack of clarity. The key point is that SO is not just a vehicle to provide code for an individual. You're expected to make your question clear and answer secondary questions. The simple and crucial ideal is that the thread should be helpful to other users in the future, and more than a way for someone to get one-to-one help in public.
– Nick Cox
Nov 15 '18 at 17:46
|
show 1 more comment
What do you mean?
– Pearly Spencer
Nov 15 '18 at 16:28
@Pearly Spencer. Student 2 does not have any CITATION or EXPULSION in there first response so the HAD variables are both 0. This is also true for student 2 second response so the HAD variables are both 0 still. Then at student 2 thirds response they have a citation so hereafter the hadCITATION variable equals to 1 for that student
– bvowe
Nov 15 '18 at 16:32
1
I don't find this clear either. You should certainly fold your comment back into the question. Also, please be more careful with spelling, punctuation, etc.
– Nick Cox
Nov 15 '18 at 17:07
1
You're more or less permanently at odds with recommendations, in that SO isn't really about us writing code for you. You are expected, at least by me, to show us your code attempt and also explain why it is still problematic.
– Nick Cox
Nov 15 '18 at 17:11
1
I am mostly in agreement with @Pearly Spencer and specifically downvoting for lack of clarity. The key point is that SO is not just a vehicle to provide code for an individual. You're expected to make your question clear and answer secondary questions. The simple and crucial ideal is that the thread should be helpful to other users in the future, and more than a way for someone to get one-to-one help in public.
– Nick Cox
Nov 15 '18 at 17:46
What do you mean?
– Pearly Spencer
Nov 15 '18 at 16:28
What do you mean?
– Pearly Spencer
Nov 15 '18 at 16:28
@Pearly Spencer. Student 2 does not have any CITATION or EXPULSION in there first response so the HAD variables are both 0. This is also true for student 2 second response so the HAD variables are both 0 still. Then at student 2 thirds response they have a citation so hereafter the hadCITATION variable equals to 1 for that student
– bvowe
Nov 15 '18 at 16:32
@Pearly Spencer. Student 2 does not have any CITATION or EXPULSION in there first response so the HAD variables are both 0. This is also true for student 2 second response so the HAD variables are both 0 still. Then at student 2 thirds response they have a citation so hereafter the hadCITATION variable equals to 1 for that student
– bvowe
Nov 15 '18 at 16:32
1
1
I don't find this clear either. You should certainly fold your comment back into the question. Also, please be more careful with spelling, punctuation, etc.
– Nick Cox
Nov 15 '18 at 17:07
I don't find this clear either. You should certainly fold your comment back into the question. Also, please be more careful with spelling, punctuation, etc.
– Nick Cox
Nov 15 '18 at 17:07
1
1
You're more or less permanently at odds with recommendations, in that SO isn't really about us writing code for you. You are expected, at least by me, to show us your code attempt and also explain why it is still problematic.
– Nick Cox
Nov 15 '18 at 17:11
You're more or less permanently at odds with recommendations, in that SO isn't really about us writing code for you. You are expected, at least by me, to show us your code attempt and also explain why it is still problematic.
– Nick Cox
Nov 15 '18 at 17:11
1
1
I am mostly in agreement with @Pearly Spencer and specifically downvoting for lack of clarity. The key point is that SO is not just a vehicle to provide code for an individual. You're expected to make your question clear and answer secondary questions. The simple and crucial ideal is that the thread should be helpful to other users in the future, and more than a way for someone to get one-to-one help in public.
– Nick Cox
Nov 15 '18 at 17:46
I am mostly in agreement with @Pearly Spencer and specifically downvoting for lack of clarity. The key point is that SO is not just a vehicle to provide code for an individual. You're expected to make your question clear and answer secondary questions. The simple and crucial ideal is that the thread should be helpful to other users in the future, and more than a way for someone to get one-to-one help in public.
– Nick Cox
Nov 15 '18 at 17:46
|
show 1 more comment
1 Answer
1
active
oldest
votes
This may help. I can't see that this makes sense without a time or sequence variable. My guess is that once you've had a CITATION or EXPULSION, then that's your history. The rules may be more complicated, but I can't see that you're explaining them. I can't see the rationale for your example for student 4.
clear
input student CITATION EXPELLED hadCITATION hadEXPELLED
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
2 0 0 0 0
2 0 0 0 0
2 1 0 1 0
2 1 0 1 0
2 0 0 1 0
3 1 0 1 0
3 0 1 1 1
3 1 1 1 1
3 1 0 1 1
3 1 0 1 1
4 . . . .
4 . 0 . 0
4 0 0 0 0
4 0 1 0 1
4 1 0 1 0
end
gen long time = _n
bysort student (time) : gen want1 = sum(CITATION) > 0
by student: gen want2 = sum(EXPELLED) > 0
list student CIT EXP hadCIT hadEXP want?, sepby(student)
+---------------------------------------------------------------------+
| student CITATION EXPELLED hadCIT~N hadEXP~D want1 want2 |
|---------------------------------------------------------------------|
1. | 1 0 0 0 0 0 0 |
2. | 1 0 0 0 0 0 0 |
3. | 1 0 0 0 0 0 0 |
4. | 1 0 0 0 0 0 0 |
5. | 1 0 0 0 0 0 0 |
|---------------------------------------------------------------------|
6. | 2 0 0 0 0 0 0 |
7. | 2 0 0 0 0 0 0 |
8. | 2 1 0 1 0 1 0 |
9. | 2 1 0 1 0 1 0 |
10. | 2 0 0 1 0 1 0 |
|---------------------------------------------------------------------|
11. | 3 1 0 1 0 1 0 |
12. | 3 0 1 1 1 1 1 |
13. | 3 1 1 1 1 1 1 |
14. | 3 1 0 1 1 1 1 |
15. | 3 1 0 1 1 1 1 |
|---------------------------------------------------------------------|
16. | 4 . . . . 0 0 |
17. | 4 . 0 . 0 0 0 |
18. | 4 0 0 0 0 0 0 |
19. | 4 0 1 0 1 0 1 |
20. | 4 1 0 1 0 1 1 |
+---------------------------------------------------------------------+
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53323825%2fupdating-running-list-if-event-happens%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This may help. I can't see that this makes sense without a time or sequence variable. My guess is that once you've had a CITATION or EXPULSION, then that's your history. The rules may be more complicated, but I can't see that you're explaining them. I can't see the rationale for your example for student 4.
clear
input student CITATION EXPELLED hadCITATION hadEXPELLED
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
2 0 0 0 0
2 0 0 0 0
2 1 0 1 0
2 1 0 1 0
2 0 0 1 0
3 1 0 1 0
3 0 1 1 1
3 1 1 1 1
3 1 0 1 1
3 1 0 1 1
4 . . . .
4 . 0 . 0
4 0 0 0 0
4 0 1 0 1
4 1 0 1 0
end
gen long time = _n
bysort student (time) : gen want1 = sum(CITATION) > 0
by student: gen want2 = sum(EXPELLED) > 0
list student CIT EXP hadCIT hadEXP want?, sepby(student)
+---------------------------------------------------------------------+
| student CITATION EXPELLED hadCIT~N hadEXP~D want1 want2 |
|---------------------------------------------------------------------|
1. | 1 0 0 0 0 0 0 |
2. | 1 0 0 0 0 0 0 |
3. | 1 0 0 0 0 0 0 |
4. | 1 0 0 0 0 0 0 |
5. | 1 0 0 0 0 0 0 |
|---------------------------------------------------------------------|
6. | 2 0 0 0 0 0 0 |
7. | 2 0 0 0 0 0 0 |
8. | 2 1 0 1 0 1 0 |
9. | 2 1 0 1 0 1 0 |
10. | 2 0 0 1 0 1 0 |
|---------------------------------------------------------------------|
11. | 3 1 0 1 0 1 0 |
12. | 3 0 1 1 1 1 1 |
13. | 3 1 1 1 1 1 1 |
14. | 3 1 0 1 1 1 1 |
15. | 3 1 0 1 1 1 1 |
|---------------------------------------------------------------------|
16. | 4 . . . . 0 0 |
17. | 4 . 0 . 0 0 0 |
18. | 4 0 0 0 0 0 0 |
19. | 4 0 1 0 1 0 1 |
20. | 4 1 0 1 0 1 1 |
+---------------------------------------------------------------------+
add a comment |
This may help. I can't see that this makes sense without a time or sequence variable. My guess is that once you've had a CITATION or EXPULSION, then that's your history. The rules may be more complicated, but I can't see that you're explaining them. I can't see the rationale for your example for student 4.
clear
input student CITATION EXPELLED hadCITATION hadEXPELLED
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
2 0 0 0 0
2 0 0 0 0
2 1 0 1 0
2 1 0 1 0
2 0 0 1 0
3 1 0 1 0
3 0 1 1 1
3 1 1 1 1
3 1 0 1 1
3 1 0 1 1
4 . . . .
4 . 0 . 0
4 0 0 0 0
4 0 1 0 1
4 1 0 1 0
end
gen long time = _n
bysort student (time) : gen want1 = sum(CITATION) > 0
by student: gen want2 = sum(EXPELLED) > 0
list student CIT EXP hadCIT hadEXP want?, sepby(student)
+---------------------------------------------------------------------+
| student CITATION EXPELLED hadCIT~N hadEXP~D want1 want2 |
|---------------------------------------------------------------------|
1. | 1 0 0 0 0 0 0 |
2. | 1 0 0 0 0 0 0 |
3. | 1 0 0 0 0 0 0 |
4. | 1 0 0 0 0 0 0 |
5. | 1 0 0 0 0 0 0 |
|---------------------------------------------------------------------|
6. | 2 0 0 0 0 0 0 |
7. | 2 0 0 0 0 0 0 |
8. | 2 1 0 1 0 1 0 |
9. | 2 1 0 1 0 1 0 |
10. | 2 0 0 1 0 1 0 |
|---------------------------------------------------------------------|
11. | 3 1 0 1 0 1 0 |
12. | 3 0 1 1 1 1 1 |
13. | 3 1 1 1 1 1 1 |
14. | 3 1 0 1 1 1 1 |
15. | 3 1 0 1 1 1 1 |
|---------------------------------------------------------------------|
16. | 4 . . . . 0 0 |
17. | 4 . 0 . 0 0 0 |
18. | 4 0 0 0 0 0 0 |
19. | 4 0 1 0 1 0 1 |
20. | 4 1 0 1 0 1 1 |
+---------------------------------------------------------------------+
add a comment |
This may help. I can't see that this makes sense without a time or sequence variable. My guess is that once you've had a CITATION or EXPULSION, then that's your history. The rules may be more complicated, but I can't see that you're explaining them. I can't see the rationale for your example for student 4.
clear
input student CITATION EXPELLED hadCITATION hadEXPELLED
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
2 0 0 0 0
2 0 0 0 0
2 1 0 1 0
2 1 0 1 0
2 0 0 1 0
3 1 0 1 0
3 0 1 1 1
3 1 1 1 1
3 1 0 1 1
3 1 0 1 1
4 . . . .
4 . 0 . 0
4 0 0 0 0
4 0 1 0 1
4 1 0 1 0
end
gen long time = _n
bysort student (time) : gen want1 = sum(CITATION) > 0
by student: gen want2 = sum(EXPELLED) > 0
list student CIT EXP hadCIT hadEXP want?, sepby(student)
+---------------------------------------------------------------------+
| student CITATION EXPELLED hadCIT~N hadEXP~D want1 want2 |
|---------------------------------------------------------------------|
1. | 1 0 0 0 0 0 0 |
2. | 1 0 0 0 0 0 0 |
3. | 1 0 0 0 0 0 0 |
4. | 1 0 0 0 0 0 0 |
5. | 1 0 0 0 0 0 0 |
|---------------------------------------------------------------------|
6. | 2 0 0 0 0 0 0 |
7. | 2 0 0 0 0 0 0 |
8. | 2 1 0 1 0 1 0 |
9. | 2 1 0 1 0 1 0 |
10. | 2 0 0 1 0 1 0 |
|---------------------------------------------------------------------|
11. | 3 1 0 1 0 1 0 |
12. | 3 0 1 1 1 1 1 |
13. | 3 1 1 1 1 1 1 |
14. | 3 1 0 1 1 1 1 |
15. | 3 1 0 1 1 1 1 |
|---------------------------------------------------------------------|
16. | 4 . . . . 0 0 |
17. | 4 . 0 . 0 0 0 |
18. | 4 0 0 0 0 0 0 |
19. | 4 0 1 0 1 0 1 |
20. | 4 1 0 1 0 1 1 |
+---------------------------------------------------------------------+
This may help. I can't see that this makes sense without a time or sequence variable. My guess is that once you've had a CITATION or EXPULSION, then that's your history. The rules may be more complicated, but I can't see that you're explaining them. I can't see the rationale for your example for student 4.
clear
input student CITATION EXPELLED hadCITATION hadEXPELLED
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
2 0 0 0 0
2 0 0 0 0
2 1 0 1 0
2 1 0 1 0
2 0 0 1 0
3 1 0 1 0
3 0 1 1 1
3 1 1 1 1
3 1 0 1 1
3 1 0 1 1
4 . . . .
4 . 0 . 0
4 0 0 0 0
4 0 1 0 1
4 1 0 1 0
end
gen long time = _n
bysort student (time) : gen want1 = sum(CITATION) > 0
by student: gen want2 = sum(EXPELLED) > 0
list student CIT EXP hadCIT hadEXP want?, sepby(student)
+---------------------------------------------------------------------+
| student CITATION EXPELLED hadCIT~N hadEXP~D want1 want2 |
|---------------------------------------------------------------------|
1. | 1 0 0 0 0 0 0 |
2. | 1 0 0 0 0 0 0 |
3. | 1 0 0 0 0 0 0 |
4. | 1 0 0 0 0 0 0 |
5. | 1 0 0 0 0 0 0 |
|---------------------------------------------------------------------|
6. | 2 0 0 0 0 0 0 |
7. | 2 0 0 0 0 0 0 |
8. | 2 1 0 1 0 1 0 |
9. | 2 1 0 1 0 1 0 |
10. | 2 0 0 1 0 1 0 |
|---------------------------------------------------------------------|
11. | 3 1 0 1 0 1 0 |
12. | 3 0 1 1 1 1 1 |
13. | 3 1 1 1 1 1 1 |
14. | 3 1 0 1 1 1 1 |
15. | 3 1 0 1 1 1 1 |
|---------------------------------------------------------------------|
16. | 4 . . . . 0 0 |
17. | 4 . 0 . 0 0 0 |
18. | 4 0 0 0 0 0 0 |
19. | 4 0 1 0 1 0 1 |
20. | 4 1 0 1 0 1 1 |
+---------------------------------------------------------------------+
edited Nov 15 '18 at 17:48
answered Nov 15 '18 at 17:10
Nick CoxNick Cox
25.4k42139
25.4k42139
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53323825%2fupdating-running-list-if-event-happens%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What do you mean?
– Pearly Spencer
Nov 15 '18 at 16:28
@Pearly Spencer. Student 2 does not have any CITATION or EXPULSION in there first response so the HAD variables are both 0. This is also true for student 2 second response so the HAD variables are both 0 still. Then at student 2 thirds response they have a citation so hereafter the hadCITATION variable equals to 1 for that student
– bvowe
Nov 15 '18 at 16:32
1
I don't find this clear either. You should certainly fold your comment back into the question. Also, please be more careful with spelling, punctuation, etc.
– Nick Cox
Nov 15 '18 at 17:07
1
You're more or less permanently at odds with recommendations, in that SO isn't really about us writing code for you. You are expected, at least by me, to show us your code attempt and also explain why it is still problematic.
– Nick Cox
Nov 15 '18 at 17:11
1
I am mostly in agreement with @Pearly Spencer and specifically downvoting for lack of clarity. The key point is that SO is not just a vehicle to provide code for an individual. You're expected to make your question clear and answer secondary questions. The simple and crucial ideal is that the thread should be helpful to other users in the future, and more than a way for someone to get one-to-one help in public.
– Nick Cox
Nov 15 '18 at 17:46