Code
library(nanoAFMr)
library(dataZIF8)
library(ggplot2)
library(cowplot)
<- dataAFMget() m
Thomas Gredig
December 4, 2024
In this code, we are computing the height-height correlation function for several AFM images at once. We need to check that the fit is good, such that the parameters that we will use are valid. At the same time, the idea is to condense the graph into a half-page; so that we can quickly check whether there are any problems with the fit.
We use the cowplot
R package to create a 3x4 grid in this example. It includes the function plot_grid() to put multiple images into one graph:
Error in nls(data = r, g ~ 2 * (sigma * sigma) * (1 - exp(-(r.nm/xi)^(2 * :
number of iterations exceeded maximum of 50
Error in nls(data = r, g ~ 2 * (sigma * sigma) * (1 - exp(-(r.nm/xi)^(2 * :
number of iterations exceeded maximum of 50
Error in numericDeriv(form[[3L]], names(ind), env, central = nDcentral) :
Missing value or an infinity produced when evaluating the model
AFM graphs:
Height-height Correlation Graphs:
@misc{gredig2024,
author = {Gredig, Thomas and Gredig, Thomas},
title = {Multiple {Graphs}},
date = {2024-12-04},
url = {https://www.csulb.edu/~tgredig/posts/Rcode/multiGraph.html},
langid = {en}
}