[R] Yext in parentheses.

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Thu Oct 26 19:12:38 CEST 2023


I recommend cutting snippets out of your code by stopping the code at the point of interest and using dput() to pull out "data as it is" before the troublesome section and then using the reprex package to test that the snippet runs.

Either you will notice the problem on your own while taking this time, or you will end up with something we can actually try out. Your current approach fails to provide everything we might need precisely because you don't know what you need to know to solve your problem.

If you have privacy issues with the data then once you have a reprex you can make a shareable reprex by replacing the private data with generic data of the same type. Also, you should often experiment to reduce the size of your sample data to a minimum necessary to reproduce the problem, as this will often remove unnecessary confusion as well.

Remember, you are trying to learn how to solve your problems on your own anyway, so this is not wasted time even if you do end up solving it on your own.

On October 26, 2023 9:18:10 AM PDT, Steven Yen <styen using ntu.edu.tw> wrote:
>Dear All
>
>My program is long and sorry I do not have a replicable set of codes to 
>present. But I present a chunk of codes at the end below. Essentially,
>
>1. I initialize cat.ref as NUL (see line 1)
>
>2. Then, I repeatedly add elements to cat.ref, where each element 
>include parentheses in double quotations (see line 2).
>
>I had expected cat.ref to eventually contain the list
>
>dilemma1(ref),scigrn1(ref),...
>
>Not so, I end up getting the following (see first column; not in 
>parentheses, like (ref.)).
>
>dilemma1.ref.. 22.356 2.619 8.535 0.000 *** scigrn1.ref.. 22.474 2.697 
>8.334 0.000 ***
>
>Any idea how I might revise lines like the following (first line below):
>
>dv.group<-c("dilemma2","dilemma3"); cat.ref<-"dilemma1(ref.)"
>
>etc. Thanks.
>
>   ap0<-zx.ref<-NULL
>
>   dv.group<-c("dilemma2","dilemma3"); cat.ref<-"dilemma1(ref.)"
>   if(any(dv.group%in%jindex)){
>     v<-pred0(dv.group,cat.ref)
>     ap0<-rbind(ap0,v$ap0); zx.ref<-c(zx.ref,v$cat.ref)
>   }
>
>   dv.group<-c("scigrn2","scigrn3"); cat.ref<-"scigrn1(ref.)"
>   if(any(dv.group%in%jindex)){
>     v<-pred0(dv.group,cat.ref)
>     ap0<-rbind(ap0,v$ap0); zx.ref<-c(zx.ref,v$cat.ref)
>   }
>
>
>	[[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.

-- 
Sent from my phone. Please excuse my brevity.



More information about the R-help mailing list