On 12/03/04 20:48, Jim Lemon wrote:>I think this program or something similar could produce a regularly updated >list of functions available on CRAN, and that list would be easy enough to >search to encourage anyone who was looking for a function to try it.My search site (below) also allows searching functions. The problem I often find is that the terms used in the query are not in the help files for the functions, or even in the r-help discussion of them. I think there is no solution to this problem, unless someone wants to write a program that translates (e.g.) from economics-English to psychology-English and both to statistics-English. Jon -- Jonathan Baron, Professor of Psychology, University of Pennsylvania Home page: http://www.sas.upenn.edu/~baron R search page: http://finzi.psych.upenn.edu/
Jim Lemon <bitwrit <at> ozemail.com.au> writes:> I have been thinking about how to reduce the number of basic questions that > elicit the ...ahem... robust debate that has occurred about how to answerThe traffic on r-help could be reduced by creating a second list where more elementary questions are asked. There may be other ways to partition the universe of questions as well.
On 2 Dec 2004, at 1:23 am, Gabor Grothendieck wrote:> > Jim Lemon <bitwrit <at> ozemail.com.au> writes: > >> I have been thinking about how to reduce the number of basic >> questions that >> elicit the ...ahem... robust debate that has occurred about how to >> answer > > > The traffic on r-help could be reduced by creating a second list where > more elementary questions are asked.But how many people here would read it, and help the novices (like me) out? There is always the danger that novice lists just become write-only lists. Tim -- Dr Tim Cutts Informatics Systems Group, Wellcome Trust Sanger Institute GPG: 1024D/E3134233 FE3D 6C73 BBD6 726A A3F5 860B 3CDD 3F56 E313 4233
What about starting a database? I know it is a lot of work but one of the difficulties one encounter with R is taht i can be diffcult to know where to look for answers...I do agree that a basic list will tend to be a write only list! (and I take the opportunity here tp thank all of you for your patient answers !) Anne ----- Original Message ----- From: "Tim Cutts" <tjrc at sanger.ac.uk> To: <ggrothendieck at myway.com> Cc: <r-help at stat.math.ethz.ch>; <bitwrit at ozemail.com.au> Sent: Thursday, December 02, 2004 6:17 PM Subject: Re: [R] A possible way to reduce basic questions> > On 2 Dec 2004, at 1:23 am, Gabor Grothendieck wrote: > > > > > Jim Lemon <bitwrit <at> ozemail.com.au> writes: > > > >> I have been thinking about how to reduce the number of basic > >> questions that > >> elicit the ...ahem... robust debate that has occurred about how to > >> answer > > > > > > The traffic on r-help could be reduced by creating a second list where > > more elementary questions are asked. > > But how many people here would read it, and help the novices (like me) > out? There is always the danger that novice lists just become > write-only lists. > > Tim > > -- > Dr Tim Cutts > Informatics Systems Group, Wellcome Trust Sanger Institute > GPG: 1024D/E3134233 FE3D 6C73 BBD6 726A A3F5 860B 3CDD 3F56 E313 4233 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide!http://www.R-project.org/posting-guide.html>
I would like to add a few points on the increasing size of r-help. 1. this is a possitive sign that more and more people migrate to R. For starting users of R or a R package, the r-help is unique way to seek answers. Gradually, once starting, I trust, users are finding ways to search answers. 2. DO NOT disencourage users to ask bassic questions, this may scare starters away from R. I believe, most of us experienced such transsion, from basic questions to good familarity with R or some R packages. We should encourage experienced users contribute to Q-A. 3. We may start forming interesting groups to deal with some specifical questions. It is true that not everyone using all packages, or not many people mastering on all packages, but a few users may know almost every aspect of some packages. If a task force can analyse the previous questions, cluster them and identify a number of key areas, this may be a useful start to group people. Directing questions to target groups may produce quick and fruitful answers. Yuandan On Thu, 2 Dec 2004 17:17:21 +0000 Tim Cutts <tjrc at sanger.ac.uk> wrote:> > On 2 Dec 2004, at 1:23 am, Gabor Grothendieck wrote: > > > > > Jim Lemon <bitwrit <at> ozemail.com.au> writes: > > > >> I have been thinking about how to reduce the number of basic > >> questions that > >> elicit the ...ahem... robust debate that has occurred about how to > >> answer > > > > > > The traffic on r-help could be reduced by creating a second list where > > more elementary questions are asked. > > But how many people here would read it, and help the novices (like me) > out? There is always the danger that novice lists just become > write-only lists. > > Tim > > -- > Dr Tim Cutts > Informatics Systems Group, Wellcome Trust Sanger Institute > GPG: 1024D/E3134233 FE3D 6C73 BBD6 726A A3F5 860B 3CDD 3F56 E313 4233 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.htmlAnimal Genetics and Breeding Unit The University of New England Armidale, NSW, Australia, 2351
I have been thinking about how to reduce the number of basic questions that elicit the ...ahem... robust debate that has occurred about how to answer them. One theme of such questions is "I want to do this, is there a function to do it?" These usually receive the: ?something reply if the respondent is in a good mood. I hypothesize that if those seeking a function had a searchable list of all the functions available, they would be more likely to discover the answer for themselves. I sincerely hope that this would help both the questioners and the answerers and the list maintainers. To this end, I have written a small C program that compiles and runs on my Linux system. Given the R library directory as an argument, it builds a list of all the INDEX files, then writes an HTML page with a table for each package present. As all HTML browsers with which I am familiar can search a page for arbitrary strings, this will allow the questioner to search for the presence of the term they seek in the INDEX file of any package. I think this program or something similar could produce a regularly updated list of functions available on CRAN, and that list would be easy enough to search to encourage anyone who was looking for a function to try it. It's a bit rough at the moment, as INDEX files vary in format, but I am willing to refine the program if those responsible for the CRAN sites would be willing to use it. Jim
As there seems to be some interest in this concept, I'll include the C code (The attachment seems to have been deleted from my last message). I compiled this as follows: gcc -o indxlst indxlst.c It runs like this: indxlst -t <path_to_R_library_directory> producing a file named INDEX_list.html that should be viewable with any HTML browser. Jim /* indxlst.c A program to search R INDEX files and build an HTML page of their contents */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <ctype.h> #include <sys/stat.h> #define MAX_LINE 128 typedef struct { char *top_dir; FILE *instream; FILE *htmlstream; } IL_INFO; void InitializeILInfo(IL_INFO *il_info) { il_info->top_dir = NULL; } /* Usage Displays a simple usage message. */ void Usage(void) { char *helplines[] {"\nUsage: indxlst -t <R library directory> -h\n", NULL }; int line = 0; while(helplines) fprintf(stdout,"%s",helplines[line++]); } /* ProcessArgs Tries to process all valid arguments supplied to the program on the command line. Return value 0 = all arguments valid AND R library path specified 1 = at least one bad argument OR R library path not specified */ int ProcessArgs(int nargs,char **arg,IL_INFO *il_info) { int optchar; int badargs = 0; while((optchar = getopt(nargs,arg,"ht:")) != -1) { switch(optchar) { case 'h' : Usage(); break; case 't' : il_info->top_dir = optarg; break; case '?' : badargs++; fprintf(stderr,"Invalid argument - %c\n",optopt); } } return(badargs || !il_info->top_dir); } void StartHTMLfile(FILE *current_stream) { fprintf(current_stream,"<html><head><title>R function listing</title></head>\n"); fprintf(current_stream,"<body><center><h1>R function listing</h1></center>\n"); } void EndHTMLfile(FILE *current_stream) { fprintf(current_stream,"</body></html>\n"); } void GetINDEXpaths(IL_INFO *il_info) { char find_cmd[MAX_LINE]; strcpy(find_cmd,"find "); strcat(find_cmd,il_info->top_dir); strcat(find_cmd," -name INDEX > INDEX_list.txt\n"); system(find_cmd); } int ProcessINDEXFiles(IL_INFO *il_info) { FILE *IFstream; char current_file[MAX_LINE]; char *package_name; char *desc_ptr; char INDEX_line[MAX_LINE]; int retval = 1; int filename_index; il_info->htmlstream = fopen("INDEX_list.html","w"); if(il_info->htmlstream) { StartHTMLfile(il_info->htmlstream); IFstream = fopen("INDEX_list.txt","r"); if(IFstream) { while(!feof(IFstream)) { if(fgets(current_file,MAX_LINE,IFstream)) { filename_index = 0; while(current_file[filename_index] > 31) filename_index++; current_file[filename_index] = 0; il_info->instream = fopen(current_file,"r"); if(il_info->instream) { /* find the last slash in the path */ package_name = strrchr(current_file,'/'); /* null terminate at the slash */ *package_name = 0; /* go back to the next slash */ package_name = strrchr(current_file,'/'); /* move to the package name */ package_name++; fprintf(il_info->htmlstream,"<h2>%s</h2><table>\n",package_name); while(!feof(il_info->instream)) { fgets(INDEX_line,MAX_LINE,il_info->instream); desc_ptr = INDEX_line; while(*desc_ptr > 32) desc_ptr++; /* if there was more than one word on the line */ if(desc_ptr) { *desc_ptr = 0; *desc_ptr++; fprintf(il_info->htmlstream,"<tr><td>%s<td>%s</tr>\n", INDEX_line,desc_ptr); } else fprintf(il_info->htmlstream,"<tr><td>%s</tr>\n",INDEX_line); } fprintf(il_info->htmlstream,"</table>\n"); fclose(il_info->instream); } else printf("Can't open INDEX file %s",current_file); } retval = 0; } fclose(IFstream); } else printf("Can't open INDEX_list.txt\n"); EndHTMLfile(il_info->htmlstream); fclose(il_info->htmlstream); } else printf("Can't open INDEX_list.html\n"); } int main(int argc,char *argv[]) { IL_INFO il_info; int retval = 1; InitializeILInfo(&il_info); if(!ProcessArgs(argc,argv,&il_info)) { GetINDEXpaths(&il_info); ProcessINDEXFiles(&il_info); /* get rid of the list of INDEX files */ unlink("INDEX_list.txt"); } else Usage(); return(retval); }
On 12/02/04 21:15, Anne wrote:>What about starting a database?Of what? Like the one in the last line of my .sig? -- Jonathan Baron, Professor of Psychology, University of Pennsylvania Home page: http://www.sas.upenn.edu/~baron R search page: http://finzi.psych.upenn.edu/