ediblecity: an R package to model and estimate the benefits of urban agriculture

Urban agriculture is gaining attraction to become one of the pillars of the urban ecological transition and to increase food security in an urbanized planet. However, there is a lack of systematic quantification of the benefits provided by urban agriculture solutions. In this paper, we present an R package to estimate several indicators related to benefits of urban agriculture. The goal is to provide a tool for researchers and practitioners interested in the impacts of urban agriculture. The ediblecity package provides functions to calculate 8 indicators: urban heat island, runoff prevention, green areas accessibility, NO 2 sequestration, jobs created in commercial gardens, volunteers involved in community gardens, green per capita and, finally, food production. Moreover, the package also provides a function to generate scenarios with different implementations of urban agriculture. We illustrate the use of the package by comparing three scenarios in a neighborhood of Girona (Spain), which is included in the package as an example dataset. There, we compare scenarios with an increasing amount of urban agriculture solutions. The ediblecity package is open-source software. This allows other R developers to contribute to the package, providing new functionalities or improving the existing ones.


Introduction
Urban agriculture is becoming one of the pillars of the urban ecological transition (Säumel et al., 2019).Likewise, urban agriculture might have a key role ensuring food security in an urbanized planet (Barthel et al., 2015).As a consequence, some research has paid attention on the actual or potential food production of urban agriculture (Grafius et al., 2020;Richardson & Moskal, 2016).However, some others authors argued that the importance of urban agriculture does not reside in its ability to produce food but in the social benefits it provides, such as public health (Soga et al., 2017) and social cohesion (Säumel et al., 2019).Moreover, other authors stated that urban agriculture can provide environmental benefits as well, such as climate regulation (Clinton et al., 2018) or water runoff prevention (Gittleman et al., 2017).
However, there is a lack of systematic quantification of the benefits provided by urban agriculture (Langemeyer et al., 2021a).For instance, there is no clear evidence to what extent urban agriculture could contribute to reduce the urban heat island (Lin et al., 2015) or to a greener economy (Säumel et al., 2019).However, most studies have been focused on a single initiative and one benefit (Artmann & Sartison, 2018).
Therefore, decision-makers, who are responsible of leading the urban transitions to more sustainable and resilient cities, are orphan of evidence in how to implement urban agriculture to maximize its impact on sustainability.Yet, several studies have provided some insights that can guide the implementation of urban agriculture.For instance, some models explore the rainwater harvesting potential of urban agriculture (Gittleman et al., 2017;Lupia et al., 2017).Broader, Gómez-Villarino and Ruiz-Garcia (2021) developed guidelines to maximize ecosystem services through urban agriculture by applying adaptive design and providing a battery of indicators.And, as expected, many models have been developed to quantify food production and food security provided by urban agriculture by simulating a myriad of scenarios with different types of urban agriculture virtually implemented such as rooftop gardens, community gardens or private citizen-led gardens (Grafius et al., 2020;Grewal & Grewal, 2012;Hsieh et al., 2017;MacRae et al., 2010).Yet, a transferable model (applicable to any city) to assess simultaneously several environmental and social benefits is lacking.
Hence, our goal is to provide a tool to estimate those multiple benefits of urban agriculture that help decision-makers to strategically implement urban agriculture solutions.We developed the estimations for eight indicators measuring urban agriculture benefits and a functionality to create scenarios of urban agriculture based on the proportion of elements to be transformed to urban agriculture and on which elements will be transformed.Likewise, we packed all those functionalities in an R package called ediblecity.In the Methods, we present the interface of the package and then we illustrate the usefulness by applying the model to a neighborhood of Girona (Spain).
While the package offers default values for nearly all necessary parameters, it's worth noting that these defaults have been tailored to our specific example, which focuses on a mid-sized Western Mediterranean European city.Nevertheless, it's important to emphasize that users have the flexibility to customize all parameters according to their specific context.

Methods
Implementation: the model under the package All the equations and algorithms to model the benefits of urban agriculture were encapsulated in an R package (R Core Team, 2022), using one function for each indicator and one function to create scenarios.The package was created using R version 4.2.1 (R Core Team, 2022) in RStudio desktop v. 2022.07.02.The package structure was assisted by the package devtools (Wickham et al., 2022b) following the principles in Wickham and Bryan (2022).Likewise, the documentation of the functions was assisted by the package roxygen2 (Wickham et al., 2022a).The dependencies of the package are: • dplyr (>= 1.0.6)(Wickham et al., 2023a)

Amendments from Version 1
This new version includes several improvements regarding different sections of the paper.First, we included at the end of the introduction a paragraph about the transferability of the model to other contexts.We also included information on the criteria used to choose the indicators estimated by the tool.We added limitations regarding the negative impacts of urban agriculture that is not included in our model.We added the additional software packages required to reproduced the Use case section.Finally, we also included additional information to help in the interpretation of the indicators estimated.
Any further responses from the reviewers can be found at the end of the article

REVISED
• magrittr (>= 2.0.1)(Bache & Wickham, 2022) • sf (>=0.9)(Pebesma, 2018a) • stars (>= 0.5) (Pebesma, 2022) • rlang (>= 1.0) (Henry & Wickham, 2022b) Urban representation of the city of interest.The ediblecity package provides eight functions to estimate eight different indicators and a function to generate scenarios.It takes, as a basis, a spatial representation of a city (or a part of a city) as a GIS layer.This representation must have one attribute indicating the land uses of the city, such as gardens, streets, rooftops, etc.Some indicators require specific information to be included in the representation.This is explained in each indicator's section.
The package includes the representation of Sant Narcís, a neighbourhood of Girona (Spain) as an example of an urban representation (Figure 1).This example can help the users to create the representation of their cities of interest.In the Table 1 below, a sample with one element of each type is shown.The representation is provided as an sf object, which is a class for spatial data in R implemented by package sf (Pebesma, 2018b) Along with the example for an urban representation, the ediblecity package also includes a data.framewith the default attributes of each green typology in the urban representation used to estimate the indicators (Table 2).This includes types of urban agriculture along with other types of green infrastructure.However, The surface that is used to grow edible plants.Only applicable to urban agriculture solutions the user can provide their own attributes to estimate any indicator.In city_land_uses there are other columns not shown in Table 2, they are logical variables (i.e.TRUE/FALSE) used internally by the package to select urban agriculture elements.
pGreen is the proportion of green of the urban element.In urban agriculture solutions, this is overridden by the attribute edible_area.The following attributes come in pairs (min, max) to consider uncertainty in the estimations.The functions use a random value within the range provided by the pair of values for each element in the city.We used a random uniform distribution, i.e., all values within the rage have the same probability of being picked.no2_seq is the capacity of the element to capture NO 2 in gr/s.food is the food productivity in kg/m 2 and CN is their curve number, used to calculate infiltration rates.The details are provided in following sections.(2 ) where Fveg is the proportion of vegetation in cell i; Q q l is the daily average global radiation (in W/m 2 /hour); C air is the air heat capacity (in J); P air is air density (in kg/m 3 ); ∆T is the difference between the maximum and minimum daily average temperatures (in ºC); and U is the daily average wind speed (in m/s).

Indicators estimated.
The indicator to estimate the urban heat island is implemented by the package under the function UHI (code snippet 1).The user must provide the urban representation (x) and the raster with SVF values (SVF).The green_df argument is a data.framewith the proportion of green of each land_use in the urban representation (Fveg in the equation).All the meteorological arguments are provided by default, based on the example provided (Mediterranean climate).However, the user can override them to provide values of their city of interest.Runoff prevention Surface runoff is the flow of water occurring on the ground surface when excess rainwater can no longer sufficiently rapidly infiltrate in the soil.Hence, runoff mitigation contributes to climate resilience since rain events will increase due to climate change (Shukla et al., 2019).The indicator measures the runoff in the city after a specific 24-hours rain event as well as the amount of rainwater harvested by harvesting systems.We departed from the model developed by the Soil Conservation Service (USDA), known as SCS runoff curve number method (Cronshey et al., 1985).where Q is the runoff in mm; P is the rainfall volume in mm; I a is the initial abstraction (all losses before runoff begins); and S is the potential soil moisture retention, which is a function of the curve number (which is determined by hydrologic soil group, see Cronshey, Roberts, and Miller (1985) for more details on the method).
The SCS generalizes I a as 0.2S, we modified this generalization to include the rainwater harvested: where Rh is the potential water harvested by the element i, calculated as the amount of water fallen on the surface of adjacent higher buildings that are not used for gardening (in litres); Ws is the water storage capacity of the element i in terms of tank volume (in litres).From both, the minimum is used to calculate I a .
The runoff_prev function estimates the runoff (Q in the equation) as well as the total rainfall in x and the total rainwater harvested in cubic meters (code snippet 2).Along with the urban representation (x), the user must provide a data.frame(runoff_df argument) with four variables: land use, minimum and maximum curve numbers and a logical variable indicating whether the land use (a urban garden, a building,. . . ) has potential to harvest rainwater.The argument rain allows to set the rain event (in mm), which must be defined by the user.The curve number of each element is randomized within this range provided in runoff_df.If runoff_df is not provided, city_land_uses is used instead.Following, floors_field is the name of attribute in x that specifies the number of floors of each element; harvest_dist (in m) is the maximum distance to consider that a building is adjacent to the element; and tank_size is a range for the volume of the rainwater tank, proportional to the surface of the element (in l/m 2 Green areas accessibility This indicator calculates the distance from each home to the closest public green area and return a summary of statistics (min, 25%, 50%, mean, 75% and max).It includes the possibility to exclude areas smaller than a threshold.The function to calculate these distances is green_distance (code snippet 3).It requires, as usual, the urban representation (x) and a vector with all the categories considered public green areas.If it is not provided, the function uses the categories from city_land_uses where the attribute public is TRUE.The argument residence_col indicates the variable of the urban representation (x) that must be used to identify the residences.Subsequently, residences indicates which categories of the ones contained by the variable passed to residence_col must be considered.The min_area argument can be used to exclude smaller areas than the value passed to the function (the threshold mentioned above).
If percent_out is set to TRUE, the function returns the percentage of houses that are further than max_dist argument from their closest public green area (excluding areas smaller than min_area).The default values for min_area and max_dist follow the recommendations of the World Health Organization, who recommended that all residences should be closer than 300 meters from a public green area larger than 0.5 ha.
Finally, if verbose argument is set to TRUE, a vector with all distances from residences to green areas (larger than min_area) is returned.Nitrogen dioxide sequestration Nitrogen dioxide is a good proxy of overall air quality (Mayer, 1999) and one of the most concerning issues in cities, with important consequences on respiratory diseases and lung cancer (Kampa & Castanas, 2008).This indicator calculates the amount of NO 2 sequestered by urban green and urban agriculture solutions (in g/s).
where a i is the area (in m 2 ) of the element i; and cap i is the capacity of element i to sequester NO 2 (in µg•s -1 m -2 ).
The function to estimate the NO 2 sequestered is no2_seq (code snippet 4).It has only two arguments; the urban representation (x) and a data.framewith four columns: • land_uses: Column with the land use.
• pGreen: The proportion of green surface in each function.
When the argument is NULL (default), the function uses the city_land_uses dataset provided with the package that contains NO 2 sequester capacity of different types of urban green.
The capacity (cap i in the previous equation) of each element is randomized within the range provided by no2_seq1 and no2_seq2.As well the area of each element is multiplied by pGreen.In urban agriculture solutions, the attribute edible_area overrides the more general pGreen.The functions to calculate these indicators are edible_jobs and edible_volunteers respectively (code snippet 5).They share the same arguments, expect for jobs and volunteers, which is the value of k in the previous equation.As usual, the first argument is the urban representation (x), edible is the land uses in x that are urban agriculture solutions (if NULL, city_land_uses is used as default), the attribute of x defining the area used to grow plants is area_col, the confidence interval is defined in interval, and if verbose is set to TRUE, instead of the confidence interval, the function returns a vector of length 1,000 with all the results of the Monte Carlo simulation.

Code
Code snippet 5: Function and arguments to calculate number of jobs created and volunteers involved in urban agriculture.

Green per capita
We propose an indicator to estimate green per capita at neighborhood level and at city level, including public and private gardens to account for environmental justice (Kabisch & Haase, 2014).At the neighborhood level a ratio between the most and least green neighborhoods is calculated, with higher values meaning a major difference between neighborhoods and less spatial justice.Moreover, since wealthier areas tend to have more private gardens (Farahani et al., 2018), these can be included in the account of green per capita to not underestimate green per capita in those neighborhoods.
The function to calculate this indicator is green_capita (code snippet 6).Along with the urban representation (x).As in other functions, the green_categories argument in the function is a list of the categories to be considered as green areas.To calculate the green per capita in the overall city, the user must provide the number of inhabitants in inhabitants.At a city level, the function returns the average amount of green per capita in the city (in m 2 /inhabitant).Likewise there are two options to calculate green per capita at a neighbourhood level.The urban representation can contain two variables indicating the name of the neighbourhood and the inhabitants (specified in name_col and inh_col arguments respectively).Or the user can provide a GIS layer with the neighbourhoods' boundaries and their attributes.Furthermore, when the private argument is set to TRUE, the private gardens are also considered.Alternatively, the user can provide a list of elements to be considered as private green areas (e.g.parks, urban gardens,. . .).When the argument verbose is set to TRUE, the function returns the green per capita in each neighbourhood instead of the ratio between the most and least green ones.Finally, the argument min_inh is to exclude neighbourhoods whose number of inhabitants is under a threshold to avoid the bias in green per capita due to unpopulated neighbourhoods (e.g.industrial districts).
Code snippet 6: Function and arguments to calculate green per capita.where y k is the yield (in kg/m 2 ) of the category k of urban garden; and a i is the area of urban garden i in m 2 .By default, the value of y is randomized using a random uniform distribution within the range defined by food1 and food2 values in city_land_uses, which are the minimum and maximum yield values found in the literature for each category of urban garden.The function computes a Monte Carlo simulation of 1,000 iterations to calculate the confidence interval.
The function that calculates the food production is food_production (code snippet 7).It takes the urban representation (x) as the first argument.If the second argument edible_df is NULL, the function uses the values from city_land_uses as specified above.Otherwise, the user can provide its own values as a data.framewith three columns: • land_uses: specifying the category of urban agriculture, it should match the categories from x.
• food1 and food2 specifies the range of the random uniform distribution to randomize yield.
The argument area_col points to the variable of x that determines the area dedicated to grow plants in each urban garden.If NULL, the total area of each element is used instead.The number passed to interval defines which confidence interval of the food production must be returned by the function.However, if verbose is set to TRUE, the function returns a vector of length 1,000 with the results of each iteration of the Monte Carlo simulation.

# Confidence interval returned by the function verbose = FALSE # Should return all the values or just the confidence interval? )
Scenarios of urban agriculture.The ediblecity package also provides the user with a function to create new scenarios based on the urban representation and a predefined set of urban agriculture solutions (Table 3) based on where they are located (private gardens, plots on ground or rooftops) and their purpose (private, community or commercial).The function returns a spatial representation of the new scenario (sf object) with the same structure of the urban representation.
The location of new urban agriculture elements is randomized among all locations that fulfill the requirements of minimum area for that element.However, this is not the case for commercial gardens, they are settled in the larger available locations, assuming that commercial initiatives have the power to acquire the best spots.
The function to create a new scenario is called set_scenario (code snippet 8).It requires many arguments but most of them have default values to facilitate its use.The function needs the urban representation (x).Then three arguments (pGardens, pVacant, pRooftop) control the proportion of new elements that must be created.The next three arguments (edible_area_*) control the proportion of the area of the new elements that is dedicated to grow plants (edible_area).The edible_area of each new elements is randomized within the range provided in the arguments.The next trio of arguments (min_area_*) specify the minimal area required to create new elements.If there are not enough elements larger than min_area_* to fulfill the first arguments, a message is displayed to inform the user (unless quiet argument is set to TRUE).Another three arguments (*_from) control which elements can be converted from the urban representation to create new urban agriculture solutions.The argument pcommercial controls the percentage of plots on ground and rooftop that should have commercial purposes instead of community.This does not affect private gardens since they are assumed to be for personal use.Finally, area_field specifies which attribute of x must be used as the area of the elements.By default, it is am attribute called flat_area that measures the area with an slope lower than 5º (in city_example).
Code snippet 8: Function and arguments to create new scenarios.# Exclude smaller rooftops private_gardens_from = "Normal garden", # Land uses to be converted to private edible gardens vacant_from = "Vacant", # Land uses to be converted to gardens on ground rooftop_from = "Rooftop", # Land uses to be converted to rooftop gardens pCommercial = 0, # Proportion of commercial gardens vs community gardens area_field = "flat_area", # Variable of x containing available surface in each element quiet = FALSE # Should the function raise warnings?)

Operation
The ediblecity package is compatible with versions of R higher than 2.10.However, it was created using version 4.2.1.Code snippet 9 shows how to install the last development version, available in r-universe.Once the package is installed, it works as any R package.It can be attached to the namespace using library(ediblecity) or preceding the functions with ediblecity::.To check the documentation of the package and its functions, type help(package="ediblecity") in the R console.

Limitations
As all abstractions of reality, the equations and algorithms of the ediblecity package present some limitations.One limitation is the use of GIS layers to create scenarios and estimate indicators, which is intrinsically in two dimensions, and sometimes 2.5 dimensions, since we consider the height of buildings.This prevents from considering other urban agriculture solutions that are relevant such as vertical farming.To consider vertical solutions, the ediblecity package should include 3D calculations.
Another limitation is the subset of indicators chosen; this is, as we said, a choice.Other indicators might be chosen instead or added to the current subset.Hopefully, the ediblecity package will be well received by the community of R scientists and other developers will add new indicators to fulfill their own needs.Indeed, this is one of the main advantages of open-source software.
Likewise, we opted to only choose indicators to estimate the benefits of urban agriculture.However, urban agriculture has also some drawbacks that could be measured.

Use cases
To replicate this section, apart from the ediblecity package, you will need to load the following packages in your R namespace using the function library(<package>):

Create scenarios of urban agriculture
To our understanding, the most important use case of the ediblecity package is to compare scenarios.To illustrate this, we created two scenarios and compared them with the original city_example (Table 4).The package ).Therefore, we first create the two scenarios and save them in a list along with the original urban representation, which we called s0 (Code snippet 10).The scenario s1 will convert the 25% of elements to urban agriculture solutions while the scenario s2 will convert the 100%.Half of gardens in vacant plots, streets and rooftop will have commercial purposes.
Code snippet 10: Code to create the scenarios.

Calculate indicators and compare scenarios
In this section, we calculate the indicators for each scenario and create tables or plots as illustration of how the results can be used.
As expected the second scenario (s2) has the lowest values for urban heat island, but not too far from the scenario s1 (Table 5).Both present a reduction of approximated 50% in average urban heat island regarding the base scenario.The absolute reduction in degrees can also be compared to the average temperature in summer in the study area.In our case study, July 2022 had an average temperature of 28°C.The reduction caused by UA would suppose a reduction of 3.5%.We can also generate a raster with the urban heat island for each scenario, like in Figure 2 Code snippet 12: Code to calculate the runoff prevention in each scenario.map_dfr(scenarios, runoff_prev, .id="scenario")|> kable(caption = "Runoff (mm), total rainfall (mˆ3ˆ) and rainwater harvested in each scenario (mˆ3ˆ)") The total rainfall presented the same value in all scenarios because we used the same rain event and all scenarios represent the same total area (Table 6).Moreover, although there was an important reduction of runoff and an increase in rainwater harvested regarding the base scenario, there was no improvement from scenario 1 to scenario 2.   As shown in Code snippet 12, the rainwater harvested was larger in scenario 1.This is explained because the algorithm uses as catchment areas all adjacent upper areas that are not used for urban agriculture.Hence, as rooftop converted to urban agriculture increases, the availability of catchment areas decrease.The infiltration rates also increase because rooftop gardens retain water but this is not enough to compensate the reduction in harvesting.However, harvested water has also some benefits, mainly water reuse.For instance, Girona's inhabitants have an average consumption of 134 litres /day.This multiplied by the inhabitants of Sant Narcís gives a total consumption of 847 m 3 /day.Hence, the water harvested in scenario 1 could provide all the water in the neighbourhood during 2 days and a half.
Code snippet 13: Code to generate a boxplot of distances to public green areas (result show in Figure 3).This indicator can be used to explore the fullfilment of WHO recommendations, which recommend that all citizens should have a green area larger than 0,5 ha closer than 300 metres (WHO, 2017).This can be achieved by adjusting the argument min_area used to calculate the indicator that filters all the green areas smaller than the value provided to the argument.
Code snippet 14: Estimation of NO 2 sequestration in all three scenarios map_dfr(scenarios, no2_seq, .id="Scenario")|> kable(caption = "Sequestration of nitrogen dioxide in each scenario") Regarding the capacity to absorb NO 2 , we see a significant improvement from base scenario to scenario 1 but not as larger from scenario 1 to scenario 2 (Table 7).Considering the car emissions limitation imposed by  the Euro 6 standard and assuming that cars drive at 50 km/h in the city, The sequestration of scenario 2 is approximately equivalent to neutralizing emissions from 130 cars (1.04 gr/s/car).
In the Code snippet 15, there is an example to calculate jobs as well as volunteers in the different scenarios.
Code snippet 15: Code to estimate jobs and volunteers in each scenario.As expected, the base scenario presented very low values; it created 0 jobs since there were no commercial garden and a median of 18.1 volunteers involved in one community garden.The number of jobs and volunteers also increased from scenario 1 to scenario 2 as well as the uncertainty related to the numbers (Figure 4).The number of jobs and volunteers can be compared to the population in the neighbourhood.In that case, using median values, the jobs of scenario 2 represents 30% of the population while the volunteers the 40%.We must note, that the scenario 2 is converting all the available streets and rooftops to urban gardens, and so the number may feel a bit overestimated.
Below, we calculated the green per capita in each neighborhoods (code snippet 16).To do so, we use another spatial data set provided by the ediblecity package (neighbourhoods_example) which contains the neighborhoods of city_example along with the inhabitants in each neighborhood.The difference between both neighborhoods (Figure 5) is due to their urban origin.Sant Narcís nord was designed like a city garden while Sant Narcís sud is mainly composed of apartments.The interesting issue is that the improvement across scenarios is larger in Sant Narcís nord that in Sant Narcís sud, evidencing that an increase in urban agriculture is not enough to achieve environmental justice unless it is ideologically planned (Jennings et al., 2012).However, remarkably, Sant Narcís sud increased from 6.6 to 9.4 m 2 /capita from base scenario to scenario 1, surpassing the standard of 9 m 2 /capita.The last, but not least, indicator provided by the ediblecity package is the food production.The food production is assumed to be higher in gardens for commercial purposes than in community gardens, the goal of which is not to maximize the production.This is especially the case of rooftops, since commercial rooftop gardens are assumed to use hydroponic technology while community rooftop gardens are assumed to use raised beds, following the study of Caputo, Rumble, and Schaefer (2020).
Code snippet 17: Code to get confidence intervals of food production in Tm/year.Although the medians are clearly different, we cannot state that food production is bigger in scenario 2 than in scenario 1 with a 95% of confidence (i.e.p-value > 0.05 in differences between s1 and s2) (Table 8).Taking the most optimistic scenario (s2 at quantile 95%) and considering the value per capita, the urban agriculture in our example could produce 191.94 kg/year/person.The daily intake of fruits and vegetables recommended by the FAO is 200 gr/person, i.e. 73 kg/person/year (FAO & WHO, 2004).Therefore, our optimistic estimation would provide 2.63 times the neighborhood's needs in fruits and vegetables.However, it would require (taking also the higher interval) 3,510 people working in commercial gardens and 4,829 volunteers involved in community gardens, which is 1.32 times the inhabitants of the neighborhood.

Disclaimer
Since the scenarios and the indicators have some stochastic parameters, the ideal procedure would be to integrate the creation of the scenarios and the estimation of indicators in a Monte Carlo simulation to get the confidence intervals for each combination of scenario and indicator.However, we rather kept things simple to better illustrate how to use the functions provided by the package.

Conclusions
In this paper, we presented the ediblecity package: An R package to model and estimate the benefits of urban agriculture.The package is ready to be used by R users with a basic level.It can be used to estimate the benefits of real cases as well as to simulate scenarios.In both cases, 8 indicators are calculated.In the example illustrated in this paper, the uncertainty is captured using stochastic parameters.Moreover, the users are able to provide their own ranges in case they have more accurate data for the case study at stake.With more accurate data, the uncertainty can be easily reduced by changing the arguments of the functions.Likewise, some assumptions of the models can be overridden with truly statements.
The ediblecity package is open-source software under MIT license.This allows other R developers to contribute to the package providing new functionalities or improving the existing ones.Therefore, an open-source software is always a work-in-progress.interact with some indicators.The article is well-structured and concise.The chosen indicators are mostly based on published literature and formulas and are well-known to the relevant scientific community, which makes them robust.I believe that some additional justification on why the authors chose these specific indicators would further increase the robustness.In my view, this justification doesn't have to be only related to the relevancy or importance for decision-making from the selected indicators.I would definitely agree with a justification saying that this is a first shot at a wide framework that aims to increase the number of indicators in the future, either from the authors' or other contributors' side.Also, some additional explanation on the usability of the obtained scores would also be interesting, probably compared to potential situations.For example, the food production indicator yields a kg/m2 value, but how should this value be used?Should the reader compare it to the surrounding peri-urban/rural production?The comparison between urban agriculture neighbours and cities is well covered by the Use Cases.

Technical comment
I've tried to reproduce parts of the code myself and most snippets worked using the city example created by the authors.I just encountered a problem in the code fragments where a projection was required (namely code snippet 1 -UHI and some parts in "Use Cases").The error was the following: proj_create_from_database: datum not found proj_create_from_database: ellipsoid not found proj_create_from_database: prime meridian not found proj_create_from_database: datum not found proj_create_from_database: ellipsoid not found proj_create_from_database: prime meridian not found I have tried several ways to solve this but the problem persists.Have you faced the same problem while developing the package?I guess that if I've found this problem other people will, so maybe it will be interesting to keep a supporting file with the most common errors up to date together with the package.

Other comments:
Section Methods; Implementation: the model under the package: It would be interesting to provide a code snippet with the package dependencies to copy-paste it into R and get the packages up and running fast.

○
Section Methods; Implementation: the model under the package: Why only dplyr is listed as package dependency when other packages from the tidyverse package collection are used ○ in the Use Cases section?Do you consider that Use Cases is not an explicit part of the package?
Statement in page 7: "The following attributes come in pairs (min, max) to consider uncertainty in the estimations.The functions use a random value within the range provided by the pair of values for each element in the city".Does the function pick a random value within the range considering the probability of occurrence (a value that appears more in the distribution is more likely to be picked), or just a random value (all values within the range have the same probability of being picked)? ○

Is the rationale for developing the new software tool clearly explained? Yes
Is the description of the software tool technically sound?Yes

Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool? Yes
Competing Interests: No competing interests were disclosed.
Reviewer Expertise: Life Cycle Assessment applied to Urban Agriculture I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard, however I have significant reservations, as outlined above.

2021). From this source, we chose 8 indicators that meet the following criteria: (1) Measurability:
The indicators can be quantitatively measured based on the area or location.( 2 R3.2 Also, some additional explanation on the usability of the obtained scores would also be interesting, probably compared to potential situations.For example, the food production indicator yields a kg/m2 value, but how should this value be used?Should the reader compare it to the surrounding peri-urban/rural production?The comparison between urban agriculture neighbours and cities is well covered by the Use Cases.
We did not add further explanations on the interpretation of the results because we wanted to focus the attention on the usability of the tool.However, as the reviewer believes this can be useful, we added some more information on how to interpret the results.

Urban heat island:
The absolute reduction in degrees can also be compared to the average temperature in summer in the study area.In our case study, July 2022 had an average temperature of 28ºC.The reduction caused by UA would suppose a reduction of 3.5%.
Runoff mitigation: However, harvested water has also some benefits, mainly water reuse.For instance, Girona's inhabitants have an average consumption of 134 litres /day.This multiplied by the inhabitants of Sant Narcís gives a total consumption of 847 m3/day.Hence, the water harvested in scenario 1 could provide all the water in the neighbourhood during 2 days and a half.

Green areas accessibility:
This indicator can be used to explore the fullfilment of WHO recommendations, which recommend that all citizens should have a green area larger than 0,5 ha closer than 300 metres (WHO, 2017).This can be achieved by adjusting the argument min_area used to calculate the indicator that filters all the green areas smaller than the value provided to the argument.

Jobs and volunteers:
The number of jobs and volunteers can be compared to the population in the neighbourhood.In that case, using median values, the jobs of scenario 2 represents 30% of the population while the volunteers the 40%.We must note, that the scenario 2 is converting all the available streets and rooftops to urban gardens, and so the number may feel a bit overestimated.
Green per capita: However, remarkably, Sant Narcís sud increased from 6.6 to 9.4 m2/capita from base scenario to scenario 1, surpassing the standard of 9 m2/capita.Regarding food production, we believe that the already existing explanation is sufficient: Taking the most optimistic scenario ( s2 at quantile 95%) and considering the value per capita, the urban agriculture in our example could produce 191.94 kg/year/person.The daily intake of fruits and vegetables recommended by the FAO is 200 gr/person, i.e. 73 kg/person/year ( FAO & WHO, 2004).Therefore, our optimistic estimation would provide 2.63 times the neighborhood's needs in fruits and vegetables.However, it would require (taking also the higher interval) 3,510 people working in commercial gardens and 4,829 volunteers involved in community gardens, which is 1.32 times the inhabitants of the neighborhood.
R3.3 I've tried to reproduce parts of the code myself and most snippets worked using the city example created by the authors.I just encountered a problem in the code fragments where a projection was required (namely code snippet 1 -UHI and some parts in "Use Cases").The error was the following: proj_create_from_database: datum not found proj_create_from_database: ellipsoid not found proj_create_from_database: prime meridian not found proj_create_from_database: datum not found proj_create_from_database: ellipsoid not found proj_create_from_database: prime meridian not found Warning messages: 1: In CPL_rasterize(file, driver, st_geometry(sf), values, options, : GDAL Message 1: The definition of geographic CRS EPSG:4258 got from GeoTIFF keys is not the same as the one from the EPSG registry, which may cause issues during reprojection operations.Set GTIFF_SRS_SOURCE configuration option to EPSG to use official parameters (overriding the ones from GeoTIFF keys), or to GEOKEYS to use custom values from GeoTIFF keys and drop the EPSG code.2: In CPL_read_gdal(as.character(x),as.character(options), as.character(driver), : GDAL Message 1: The definition of geographic CRS EPSG:4258 got from GeoTIFF keys is not the same as the one from the EPSG registry, which may cause issues during reprojection operations.Set GTIFF_SRS_SOURCE configuration option to EPSG to use official parameters (overriding the ones from GeoTIFF keys), or to GEOKEYS to use custom values from GeoTIFF keys and drop the EPSG code.I have tried several ways to solve this but the problem persists.Have you faced the same problem while developing the package?I guess that if I've found this problem other people will, so maybe it will be interesting to keep a supporting file with the most common errors up to date together with the package.
We are aware of this issue.However, the code snippet 1 is not supposed to be evaluated, it's meant to show the function arguments.The UHI indicator is calculated in the code snippet 11, which, in our case, raise the waring but not the error.Regarding the warning, this is very specific of our example.The problem is that spatial data in Catalonia is under the projection EPSG: 25831.The description of this projection for GeoTIFF (like SVF.tif) contains non-ANSI characters, which are not accepted by CRAN when a package is submitted.So, we replace the non-ANSI characters by the ANSI equivalents, and this is the reason of the warning.As it has no consequences in the result and it will not replicate when using a different raster, we believe is not worth to mention because it is very technical and specific to our case study.Moreover, we are still trying to find a solution.
R3.4 Section Methods; Implementation: the model under the package: It would be interesting to provide a code snippet with the package dependencies to copy-paste it into R and get the packages up and running fast.In principle, if the DESCRIPTION file of the package is correct, the dependencies should be installed automatically, handled by R, as happens with any package.Please, let us know if this is not the case.R3.5 Section Methods; Implementation: the model under the package: Why only dplyr is listed as package dependency when other packages from the tidyverse package collection are used in the Use Cases section?Do you consider that Use Cases is not an explicit part of the package?
In the dependencies, we cited the packages that are dependencies of the package, but not the packages used in the Use Cases section.We agree that this should be added.We added the code snippet with the libraries used, we assume that all users will know how to install the packages if needed.We believe that including snippets with package installation is an invasion of the users' environment.We added the following paragraph at the beginning of the section: To replicate this section, apart from the ediblecity package, you will need to load the following packages in your R namespace using the function library(): dplyr ( 1 The following attributes come in pairs (min, max) to consider uncertainty in the estimations.The functions use a random value within the range provided by the pair of values for each element in the city".Does the function pick a random value within the range considering the probability of occurrence (a value that appears more in the distribution is more likely to be picked), or just a random value (all values within the range have the same probability of being picked)?
We could not find enough studies to draw a distribution, so we opted for a random uniform distribution, i.e., all values within the range have the same probability of being picked.We clarify this in the paper: The following attributes come in pairs (min, max) to consider uncertainty in the estimations.The functions use a random value within the range provided by the pair of values for each element in the city.We used a random uniform distribution, i.e., all values within the rage have the same probability of being picked.
Potsdam Institute for Climate Impact Research, Potsdam, Germany General Comment: The manuscript reports an interesting software tool, i.e., an R package, which could be used to estimate the benefits of urban agriculture.Mainly, the package consists of various functions to calculate food production in urban agriculture and its benefits in terms of urban heat island effects, runoff prevention, green space, air pollution reduction, and job creation.The manuscript also presents the logic behind these calculations.The package would be interesting to promote urban agriculture.However, it does have several shortcomings.Thus, I suggest not indexing it in its current form.
First, the manuscript could have been better embedded in the existing literature on urban gardening.There are several studies estimating the potential of urban agriculture using different scenarios and assumptions, e.g., on flat roof cover, use of roof space, urban green space, etc. [see de Simone et al. 2023 1 ].Further, urban agriculture also has its own limitations.For example, this systematic review 2 mentions health and other risks associated with urban agriculture.Thus, it would be better to embed the tool in the existing literature.
Second, the demonstration of the applicability of the tool to other world regions is needed.This demonstration is essential for a proper justification of the use of this package.For example, it is not clear how this tool could capture variations across world regions, in terms of urban agricultural practices, crop yields, and climatic conditions.Further, I see the validation of this tool and comparison of its results with existing studies is missing.
Third, I am wondering if the generalization of the estimated benefits based on one tool or function makes sense or not.For example, an urban heat island is a study field in itself, which is complex.It also holds for air pollution and run-offs.
Fourth, using this package requires specific data and values for parameters.Without these data and parameters, it would not be possible for obtaining sensible results.Thus, it would be better to highlight where to get these data.
Lastly, the manuscript is currently read like a description of the R package rather than a scientific publication.A scientific publication, here software tool article, needs to be more than the description of the R package.We mentioned some of these papers in the introduction.For instance, Grafius et al., (2020) or Richardson & Moskal, (2016).We also provided some references about other benefits beyond food production (Säumel et al., 2019;Soga et al., 2017).However, we decided to not enter detail with the numbers estimated on those papers for several reasons.First, because the numbers are too divergent to be reliable, for instance from a 17% from (Grewal & Grewal, 2012) to the 82% of (De Simone et al., 2023).Also, an most important, because we believe that the paper is a software tool presentation and, as such, should focus on the tool presented.
R2.2 Further, urban agriculture also has its own limitations.For example, this systematic review (https://doi.org/10.1016/j.gfs.2023.100700)mentions health and other risks associated with urban agriculture.Thus, it would be better to embed the tool in the existing literature.
We agree that urban agriculture has also some negative impacts.We chose a naïve approach and only estimated the positive impacts.This is now mentioned in the limitations section: Likewise, we opted to only choose indicators to estimate the benefits of urban agriculture.However, urban agriculture has also some drawbacks that could be measured.R2.3 Second, the demonstration of the applicability of the tool to other world regions is needed.This demonstration is essential for a proper justification of the use of this package.For example, it is not clear how this tool could capture variations across world regions, in terms of urban agricultural practices, crop yields, and climatic conditions.Further, I see the validation of this tool and comparison of its results with existing studies is missing.
We are confident that we developed a tool that is applicable to any context, because all parameters of the model can be provided by the user (yields, meteorological data, urban representation…).Therefore, there is no point to validate the model in this paper since each application of the tool should be validated on the specific case study.Validating the results of the Use case section is out of the scope of this paper, because this is only an example on how to use the tool (as explained in the guidelines of the journal).We added this clarification to the text: While the package offers default values for nearly all necessary parameters, it's worth noting that these defaults have been tailored to our specific example, which focuses on a mid-sized Western Mediterranean European city.Nevertheless, it's important to emphasize that users have the flexibility to customize all parameters according to their specific context.
R2.4 Third, I am wondering if the generalization of the estimated benefits based on one tool or function makes sense or not.For example, an urban heat island is a study field in itself, which is complex.It also holds for air pollution and run-offs.
We totally agree with this.Our model, as all models, suffers a trade-off between simplicity and accuracy.We tried to provide a tool to estimate different benefits with the minimal information required to the user and using state-of-the-art equations and algorithms.However, this will never be more accurate than a field study with experimental measurements.As it is said, all models are wrong, but some are useful.We hope ours is useful to do a first approximation to the potential impacts of urban agriculture.
R2.5 Fourth, using this package requires specific data and values for parameters.Without these data and parameters, it would not be possible for obtaining sensible results.Thus, it would be better to highlight where to get these data.
We could specify where we get the data used for our example.But we believe that this is irrelevant since each case study must use the corresponding data sources.We used data from Catalan institutions such as the Catalan Cartographic Institute, the Catalan Statistics Institute and the Spanish cadastre.However, this is useless for a user trying to apply the tool in a case study outside Catalonia.
R2.6 Lastly, the manuscript is currently read like a description of the R package rather than a scientific publication.A scientific publication, here software tool article, needs to be more than the description of the R package.It requires proper embedding in the existing literature, demonstration of various cases in different world regions, validation and comparison of its results, and discussion of its findings together with limitations.Doing so would ensure greater use and value of the tool.
We hope that the previous comments will satisfy your concerns about the soundness of the paper.As we said, we prefer to focus on the tool and its usability rather than in the results, that are specifics of our example and not transferable at all to other case studies.
Competing Interests: No competing interests were disclosed.

Carlos Tapia
Nordregio, Stockholm, Sweden The authors provide a software tool to evaluate a selection of potential benefits of urban agriculture, focusing on the physical characteristics of the gardens.Each indicator is enabled through a devoted function with specific data requirements.The description of the computations and underlying assumptions of each function is sufficiently detailed and anchored in validated methodologies.The scenario development module looks like a decision intelligence algorithm rather than as a tool providing scenarios in which the qualities of the different agriculture developments could be compared against the indicators calculated in the previous module.The tool is deployed as an open source software package for R that users can download and use free of charge.As such, the package provides a valuable resource for city planners and urban developers engaged in the design or identification of spaces to accommodate urban gardens.
The general relevance of the tool is well explained.In their reasoning, authors place the emphasis on the lack of tools -how to measure?-, which is justified considering the applied focus of the study.However, for the sake of completeness and consistency, it would be advisable to mention the lack of an established conceptual framework in the first place -what to measure?-.In particular, the review of potential benefits -and also the risks -linked to urban agriculture is rather thin.Authors are encouraged to add references to existing reviews about this topic, including bibliometric information.Also, authors should elaborate more on the interpretation of results: which could be the optimal/reasonable thresholds to for the different indicators?
Authors are also suggested to expand the Limitations section to give more details about how the indicators were selected.The value 'choice' aspect mentioned does not seem to be enough justification.Some of the indicators related to soil coverage and distance metrics, like UHI, runoff, accessibility to gardens, green per capita, etc., seem unspecific for urban agriculture and refer to green areas in general.This should be acknowledged in the text, in particular considering the lack of more specific social indicators capturing social benefits of urban farming beyond jobs.
Another important limitation worth mentioning refers to the transferability challenge.The great diversity of urban settings undermines the capacity of this and other planning tools to be transferred to different contexts.In particular, there is a planning divide between cities in Western countries and the Global South.Authors are encouraged to mention this limitation and explain how it could be partially addressed through parametrisation.Another relevant factor potentially limiting transferability of the tool are IT-related aspects.The R system has become increasingly user-friendly over time.Still, it remains a software development tool requiring programming skills with a steep learning curve.This may limit the use of R-based libraries by unskilled persons.Reviewer Expertise: Indicator-based assessments, social sustainability, social impacts I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard, however I have significant reservations, as outlined above.

Author Response 18 Sep 2023
Josep Pueyo-Ros R1.1 The general relevance of the tool is well explained.In their reasoning, authors place the emphasis on the lack of tools -how to measure?-, which is justified considering the applied focus of the study.However, for the sake of completeness and consistency, it would be advisable to mention the lack of an established conceptual framework in the first placewhat to measure?-.In particular, the review of potential benefits -and also the riskslinked to urban agriculture is rather thin.Authors are encouraged to add references to existing reviews about this topic, including bibliometric information.
We mentioned some of these papers in the introduction.R1.2 Also, authors should elaborate more on the interpretation of results: which could be the optimal/reasonable thresholds to for the different indicators?
We did not add further explanations on the interpretation of the results because we wanted to focus the attention on the usability of the tool.However, as the reviewer believes this can be useful, we added some more information on how to interpret the results as well as some thresholds where those existed.However, we must note that thresholds are usual arbitrary.

Urban heat island:
The absolute reduction in degrees can also be compared to the average temperature in summer in the study area.In our case study, July 2022 had an average temperature of 28ºC.The reduction caused by UA would suppose a reduction of 3.5%.
Runoff mitigation: However, harvested water has also some benefits, mainly water reuse.For instance, Girona's inhabitants have an average consumption of 134 litres /day.This multiplied by the inhabitants of Sant Narcís gives a total consumption of 847 m3/day.Hence, the water harvested in scenario 1 could provide all the water in the neighbourhood during 2 days and a half.

Green areas accessibility:
This indicator can be used to explore the fullfilment of WHO recommendations, which recommend that all citizens should have a green area larger than 0,5 ha closer than 300 metres (WHO, 2017).This can be achieved by adjusting the argument min_area used to calculate the indicator that filters all the green areas smaller than the value provided to the argument.
NO2 sequestration: Considering the car emissions limitation imposed by the Euro 6 standard and assuming that cars drive at 50 km/h in the city, The sequestration of scenario 2 is approximately equivalent to neutralizing emissions from 130 cars (1.04 gr/s/car).

Jobs and volunteers:
The number of jobs and volunteers can be compared to the population in the neighbourhood.In that case, using median values, the jobs of scenario 2 represents 30% of the population while the volunteers the 40%.We must note, that the scenario 2 is converting all the available streets and rooftops to urban gardens, and so the number may feel a bit overestimated.
Green per capita: However, remarkably, Sant Narcís sud increased from 6.6 to 9.4 m2/capita from base scenario to scenario 1, surpassing the standard of 9 m2/capita.Regarding food production, we believe that the already existing explanation is sufficient: Taking the most optimistic scenario ( s2 at quantile 95%) and considering the value per capita, the urban agriculture in our example could produce 191.94 kg/year/person.The daily intake of fruits and vegetables recommended by the FAO is 200 gr/person, i.e. 73 kg/person/year ( FAO & WHO, 2004).Therefore, our optimistic estimation would provide 2.63 times the neighborhood's needs in fruits and vegetables.However, it would require (taking also the higher interval) 3,510 people working in commercial gardens and 4,829 volunteers involved in community gardens, which is 1.32 times the inhabitants of the neighborhood.
R1.3 Authors are also suggested to expand the Limitations section to give more details about how the indicators were selected.The value 'choice' aspect mentioned does not seem to be enough justification.Some of the indicators related to soil coverage and distance metrics, like UHI, runoff, accessibility to gardens, green per capita, etc., seem unspecific for urban agriculture and refer to green areas in general.This should be acknowledged in the text, in particular considering the lack of more specific social indicators capturing social benefits of urban farming beyond jobs.
We explained which criteria we followed to select these 8 indicators.We did not include more social indicators because we developed a static spatial model, so we were limited mainly by the criteria 1.Moreover, we also explained the possibility R1.4 Another important limitation worth mentioning refers to the transferability challenge.The great diversity of urban settings undermines the capacity of this and other planning tools to be transferred to different contexts.In particular, there is a planning divide between cities in Western countries and the Global South.Authors are encouraged to mention this limitation and explain how it could be partially addressed through parametrisation.
We are confident that we developed a tool that is applicable to any context, because all parameters of the model can be provided by the user (yields, meteorological data, urban representation…).We added this clarification to the text: While the package offers default values for nearly all necessary parameters, it's worth noting that these defaults have been tailored to our specific example, which focuses on a mid-sized Western Mediterranean European city.Nevertheless, it's important to emphasize that users have the flexibility to customize all parameters according to their specific context.
R1.5 Another relevant factor potentially limiting transferability of the tool are IT-related aspects.The R system has become increasingly user-friendly over time.Still, it remains a software development tool requiring programming skills with a steep learning curve.This may limit the use of R-based libraries by unskilled persons.This is totally true.Currently, the tool is reserved for users with programming skills.We chose R and not other languages such as Python, because we believe that R is the programming language of non-programmers.It is used by many scientific disciplines such as biology, sociology, geography… Yet, we are planning to develop a web-based graphical interface for the tool to reach a wider audience.Any suggestions for funding are welcome.

Table 1 .
Structure of the urban representation example.Column Description land_use A category representing the urban elements land_use_verbose A more detailed category for the element, for example, if it is residential floors The number of floors of the element, 0 for non-built area The surface of the element flat_area The surface of the element that is flat (slope < 5º) edible_area

Figure 1 .
Figure 1.The urban representation included in the 'ediblecity' package as example.
representation jobs = c(0.000163,0.022), # The k parameter edible = NULL, # The land uses that are urban agriculture area_col = "edible_area", # The variable containing the surface dedicated to grow plants interval = 0.95, # The confidence interval returned by the function verbose = FALSE # Should return all values or a summary? ) edible_volunteers( x, # The urban representation volunteers = c(0.00163,0.22), # The k parameter edible = NULL, # The land uses that are urban agriculture area_col = "edible_area", # The variable containing the surface dedicated to grow plants interval = 0.95, # The confidence interval returned by the function verbose = FALSE # Should return all values or a summary? ) representation green_categories = NULL, # The categories considered as urban green inhabitants = NULL, # The number of inhabitants in the city neighbourhoods = NULL, # The spatial representation of neighborhoods name_col = NULL, # The variable that contains de name of the neighborhoods inh_col = NULL, # The variable that contains the inhabitants of the neighborhoods private = FALSE, # Should private green be considered?verbose = FALSE, # Should return all the information or just the ratio?min_inh = 0 # Neighborhoods with less hanbitants are excluded ) Food production Although many authors stated that the main goal of urban agriculture is not to produce food (Säumel et al., 2019; Tornaghi, 2012), food production is undoubtedly an important component of urban gardens (Furness & Gallaher, 2018; Steel, 2008) and the most frequent output modeled at a city scale (Grafius et al., 2020; Grewal & Grewal, 2012).The food production is measured in terms of productivity (kg/m 2 ): representation pGardens = 1, # Proportion of private edible gardens pVacant = 1, # Proportion of vacant plots converted to gardens on ground pRooftop = 1, # Proportion of rooftops converted to rooftop gardens edible_area_garden = c(0.02,0.3), # Proportion of surface dedicated to grow plants in private gardens edible_area_vacant = c(0.52,0.75), # And in gardens on ground edible_area_rooftop = c(0.6,0.62), # And in rooftop gardens min_area_garden = 10, # Exclude smaller private gardens min_area_vacant = 100, # Exclude smaller vacant plots min_area_rooftop = 100,

Figure 2 .
Figure 2. Raster returned by the UHI function when return_raster is set to TRUE.

Figure 3 .
Figure 3.Comparison among scenarios of the distances to each residences to its closest public green area.

Figure 4 .
Figure 4. Comparison of jobs created and volunteers involved in each scenario.

Figure 5 .
Figure 5.Comparison of green per capita in both neighbourhoods of Sant Narcís.

Reviewer Report 26
July 2023 https://doi.org/10.21956/openreseurope.17334.r33637© 2023 Tapia C.This is an open access peer review report distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
the rationale for developing the new software tool clearly explained?PartlyIs the description of the software tool technically sound?YesAre sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others?YesIs sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool?PartlyCompeting Interests: No competing interests were disclosed.
to add new indicators by us or others: The current version of the package includes 8 indicators related to various urban challenges defined, as defined in part by a handbook of indicators to evaluate the impact of nature-based solutions (Dumitru & Wendling, 2021).From this source, we chose 8 indicators that meet the following criteria: (1) Measurability: The indicators can be quantitatively measured based on the area or location.(2) Direct Influence: Urban agriculture (UA) has a direct impact on the indicators, meaning that changes in UA will affect the indicator's values.(3) Relevance to UC: The indicators are directly linked to a specific UC, and at least indirectly connected to another UC, allowing us to capture multiple dimensions of urban sustainability.By considering these criteria, we ensured that the selected indicators provide a holistic understanding of the impact of UA on urban challenges.It's worth noting that the tool is open source.Therefore, new indicators can be added in the future either by the creators or by other users interested in specific aspects of UA.
The current version of the package includes 8 indicators related to various urban challenges defined, as defined in part by a handbook of indicators to evaluate the impact of nature-based solutions (Dumitru & Wendling, 2021) From this source, we chose 8 indicators that meet the following criteria:(1) Measurability: The indicators can be quantitatively measured based on the area or location.(2) Direct Influence: Urban agriculture (UA) has a direct impact on the indicators, meaning that changes in UA will affect the indicator's values.(3) Relevance to UC: The indicators are directly linked to a specific UC, and at least indirectly connected to another UC, allowing us to capture multiple dimensions of urban sustainability.By considering these criteria, we ensured that the selected indicators provide a holistic understanding of the impact of UA on urban challenges.
It's worth noting that the tool is open source.Therefore, new indicators can be added in the future either by the creators or by other users interested in specific aspects of UA.Urban heat islandThe urban heat island is a measure of how urban agriculture can contribute to climate change adaptation, specifically to adapt cities to the increasing heat waves (Langemeyer et al., 2021b).The indicator uses the equation developed by Theeuwes et al. (2017), which was validated in 14 cities.It calculates the difference in air temperature between the urban street canyon and the rural environment.To calculate this indicator, the user must provide a raster representing the sky view factor (SVF), which describes the proportion of the unobstructed hemisphere above a certain location.SAGA, a collection of open-source algorithms for geocomputation, provides an algorithm to calculate the SVF (Conrad, 2008).

Table 2 . General attributes of the elements of urban green used to estimate the indicators. land_uses pGreen no2_seq1 no2_seq2 food1 food2 CN1 CN2
The function returns by default a summary of statistics of the UHI in x (min, 25%, 50%, mean, 75% and max values).If the argument return_raster is set to TRUE, the function returns a raster as stars object (Pebesma, 2021) with the UHI values.If verbose is set to TRUE, then the function returns a vector (i.e. an array) with the UHI in each cell.Both use the same resolution than SVF.Code snippet 1: Function and arguments to estimate urban heat island.
# Should function return a raster or numeric values?verbose= FALSE# Should the function return all the values or a summary? ) ).The volume of each tank in the city is randomized within this range and multiplied by the element where they are located.All randomizations follow a random uniform distribution within the correspondent range.
is the area in m 2 used to grow plants (edible_area) in the element i; and k is the number of jobs or volunteers by m 2 .In both functions, k is sampled from a random uniform distribution within the specified range.Then, a Monte Carlo simulation of 1,000 iterations is executed to estimate the confidence interval.The default values were based on two sources, an empirical study(CoDyre et al., 2015)and the FoodMetres project.

Table 4 . Number of agriculture solutions in each scenario and their surfaces (in squared meters).
to work well with the tidyverse framework in R (Wickham et al., 2019), especially, with the map_* family in the purrr package (Henry & Wickham, 2022a

Table 8 . Food production in Tm/year in each scenario.
Pebesma E: Simple Features for R: Standardized Support for Spatial Vector Data.The R Journal.2018b; 10(1): 439-46.Publisher Full Text Pebesma E: stars: Spatiotemporal Arrays, Raster and Vector Data Cubes.2021.Reference Source Pebesma E:

environmental risk and low yield of urban tomato gardens in Benin. Agron
Sustain Dev.2015; 35(1): 305-315.Publisher Full Text R Core Team: R:

Public space, urban agriculture and the grassroots creation of new commons: lessons and challenges for policy makers
. In: Sustainable Food Planning: Evolving Theory and Practice.edited by A. Viljoen and J. S. C. Wiskerke, Wageningen Academic Publishers, 2012; 349-364.Publisher Full Text Whittinghill LJ, Hsueh D, Culligan P, et al.: Stormwater performance of a full scale rooftop farm: Runoff water quality.Ecol Eng.2016; 91: 195-206.Publisher Full Text WHO: Urban green spaces: A brief for action.Regional Office For Europe.2017; 24.Reference Source Wickham H: ggplot2: Elegant Graphics for Data Analysis.Springer-Verlag New York, 2016.Reference Source Wickham H, Averick M, Bryan J, et al.: Welcome to the {tidyverse}.J Open Source Softw.2019; 4(43): 1686.Publisher Full Text Wickham H, Bryan J: R Packages (2e).O'REILLY.2022.Reference Source Wickham H, Danenberg P, Csárdi G, et al.: Roxygen2: In-Line Documentation for r. 2022a.Reference Source Wickham H, François R, Henry L, et al.: dplyr: A Grammar of Data Manipulation.2023a.Reference Source Wickham H, Hester J, Chang W, et al.: Devtools

: Tools to Make Developing r Packages Easier. 2022b. Reference Source Wickham
H, Henry L: purrr: Functional Programming Tools.2023.
) Direct Influence: Urban agriculture (UA) has a direct impact on the indicators, meaning that changes in UA will affect the indicator's values.(3) Relevance to UC: The indicators are directly linked to a specific UC, and at least indirectly connected to another UC, allowing us to capture multiple dimensions of urban sustainability.By considering these criteria, we ensured that the selected indicators provide a holistic understanding of the impact of UA on urban challenges.It's worth noting that the tool is open source.Therefore, new indicators can be added in the future either by the creators or by other users interested in specific aspects of UA.

the description of the software tool technically sound? Partly Are sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others? Yes Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool? No Competing Interests:
It requires proper embedding in the existing literature, demonstration of various cases in different world regions, validation and comparison of its results, and discussion of its findings together with limitations.Doing so would ensure greater use and value of the tool.No competing interests were disclosed.

have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard, however I have significant reservations, as outlined above.
Certainly, various research studies have drawn attention to a range of concerns within the realm of urban agriculture (UA).For instance, Graefe et al. (2019) emphasized the issue of heavy metal presence in cultivated plants, while Perrin et al. (2015) discussed the improper use of pesticides and fertilizers.These factors not only pose threats to both the environment and human well-being but also bring into focus the need for sustainable practices.In a similar vein, (Whittinghill et al., 2016) shed light on the dual nature of rooftop gardens.While they are effective in mitigating runoff, they can also contribute to nutrient runoff, especially when compared to extensive green roofs.This has implications for the quality of runoff water, underscoring the complexity of UA's environmental impacts.Moreover, beyond the potential environmental and health consequences, UA can also give rise to adverse social effects, as highlighted by Hawes et al. (2022).These repercussions, like the phenomenon of green gentrification, deserve careful consideration in the context of urban agriculture development.
Simone et al., 2023)s et al.,(2020)orRichardson & Moskal, (2016).We also provided some references about other benefits beyond food production(Säumel et al., 2019; Soga et al., 2017).However, we decided to not enter detail with the numbers estimated on those papers for several reasons.First, because the numbers are too divergent to be reliable, for instance from a 17% from (Grewal & Grewal, 2012) to the 82% of (DeSimone et al., 2023).Also, and most important, because we believe that the paper is a software tool presentation and, as such, should focus on the tool presented.