programing help

  1. TheEcologist

    [FAQ] How to code nicely

    This section is meant to give some general help, as proper coding is vital to good science practice. There are many of types of errors and inefficiency stemming from programming style (Kernighan & Plauger 1978). These bad practices are prolific and have even lead to retraction of publications...
  2. J

    plot histogram in r

    I have the following data set: \begin{tabular}{|l c r|} \hline X & Y & Type \\ \hline 32 & 48.5 & A \\ 36.3 & 42.9 & A \\ 45.8 & 75.8 & A \\ 60.5 & 5457.6 & B \\ 12 & 6666 & B \\ 24.2 & 48.5 & C \\ 271 & 2796.6 & C \\ \hline \end{tabular} Now I have to draw histogram of the...
  3. J

    R homework

    1. Fit appropriate regression models to describe relationship between the variables X and Y using the following three data sets separately. Use Y as the response and X as the explanatory variable. You must show all the necessary tables and fi gures for the model fi t and also comment on the fi...
  4. J

    r program. Draw the histogram of the eruption waiting periods in 'faithful '.

    #head(faithful) vct <- faithful$waiting #vct #is.vector(vct) range(vct) cls.boundary <- seq(40,100,by=10) #cls.boundary cut.vct <- cut(vct,cls.boundary,right=FALSE) #str(cut.vct) freq<-table(cut.vct) show<-cbind(freq) #show hist(show) Is this right? The Y-axis(frequency) of the...
  5. N

    renaming all variables in a large dataset

    Hello, I have 3 large datasets with over 800 variables that I need to merge. Problem is some of the datasets have the same variable names so I need to rename all the variables in each data set prior to merging. The renaming would be systematic as I would like all the variables in dataset1 to...