How to set up a non-linear mixed effects model with random effects in R using nlme? I have some data with predictor variables, A and B and response variable C. I have a grouping factor SITE.
df <- data.frame(A = c(0.4, 0.4, 0.2, 0.2, 0.2, 0.2, 0.2), B = c(0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1),
C = c(4.4, 4.3, 5.6, 4.7, 5.1, 4.5, 4.9), SITE = c("south","south","east","east", "east", "north", "north"))

The relationships between C and predictor variables are non-linear.
I have not shown all the dataframe.
I would like to fit a non-linear mixed effects model with random effects in R.
I can use nlme() to fit this model. However, I am struggling to find any 'accessible' (I don't have a strong statistics background) documentation that goes through how I can set up the model.
Could someone please assist me in sitting up my model?
My 'attempt' to set up the model is:
m1 <- nlme(C ~ A + B, data = df, random = ~1 | SITE)

However, when I run the above, I get an error: argument "start" is missing, with no default.
 A: The best place to start is with the book "Mixed-effects Models in S and S-Plus" by Pinheiro and Bates. S/S+ was the commercial precursor to R. The book is basically a description of the nlme package and the theory and best practices behind it. It gets fairly complicated in parts but has lots of examples and is overall quite accessible. 
To address your specific question and follow-up questions.
$$
C = \sqrt(A) + B
$$
This would be linear using the transformed variables and you could use the lme function within the nlme package to analyze it:
m1 <- lme(C ~ I(sqrt(A)) + B, data = df, random = ~1 | SITE)

I get an error using your mini dataframe because there isn't sufficient replication for statistical analysis, but it should work if there is more data within each site (it works as is if you remove the + B). If C was a function of something more complex that couldn't be transformed into a linear function or if the error structure is linear on the nonlinear scale you can use the nlme function as you tried to do. The error you got was because the nlme function requires you to put in starting values for all fixed effect coefficients. For example, if you had the function:
$$
C = \alpha A^{\gamma}
$$
You could analyze it as a nonlinear function
m2 <- nlme(C ~ alpha * A ^ (alpha), data = df, random = alpha ~ 1 | SITE, fixed = list(A ~ 1, B ~ 1), start = c(1, 0.01))
or as a linear function with a log transformation
$$
log(C) = log(\alpha ) + \gamma log(A)
$$
m3 <- lme(log(C) ~ log(A), data = df, random = ~1 | SITE)

These assume different error structures but are otherwise very similar approaches.
