Package reprex not available for R version 3.3.3

I’m a beginner battling a C problem and was advised to use R to create a MWE. Downloaded, and installed the latest version but my macOs doesn’t support. Downloaded a version older but can’t install the reprex package like the tutorial says to. I’ve also tried to update the R software from from tool bar but that’s unresponsive.

reprex will work on R 3.4 or greater. If you are on Big Sur or higher, you should be able to install the current version, R 4.2.1—Innocent & Trusting. However, there are two versions, one for Silicon chips and one for Intel.

For an MWE illustrating a problem in C, reprex isn't necessary and would not be simple to produce. Here's an example, mwe.c illustrating what's generally expected—a cut-and-paste-able copy of as much of the source code needed so as to fail in the same way:

/* add.c
 * a simple C program source:
#include <stdio.h>
int main()
    int i, sum = 0;
    for ( i = 1; i <= LAST; i++ ) {
      sum += i;
    } /*-for-*/
    printf("sum = %d\n", sum);

    return 0;

This lacks #define LAST 10 and produces an error on attempted compilation

➜ gcc mwe.c  
mwe.c: In function ‘main’:
mwe.c:10:23: error: ‘LAST’ undeclared (first use in this function)
   10 |     for ( i = 1; i <= LAST; i++ ) {
      |                       ^~~~
mwe.c:10:23: note: each undeclared identifier is reported only once for each function it appears in

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.