Coursera R-Programming: Week 2 Problems

The Tidy Approach

Josiah Parry

April 14, 2018

Over the past several weeks I have been helping students, career professionals, and people of other backgrounds learn R. During this time one this has become apparent, people are teaching the old paradigm of R and avoiding the tidyverse all together.

I recently had a student reach out to me in need of help with the first programming assignment from the Coursera R-Programming course (part of the Johns Hopkins Data Science Specialization). This particular student was struggling with combining the her new knowledge of R data types, conditional statements, looping, control statements, scoping, and functions to solve the assignment problem set. I provided her with a walk through of each question in base R, the style of the course. I couldn’t help but empathize with her as I too learned the long way first. However I thought that she shouldn’t be learning the hard way first (see David Robinson’s blog post , “Don’t teach students the hard way first” ), she should be learning the effective way.

In my written response to her, I gave her solutions to her problems in base R and using the tidyverse. Here, I will go over the problems and adress them from a tidy perspective. This will not serve as a full introduction to the tidyverse. For an introduction and a reason why the tidyverse is superior to base R, I leave you with Stat 545 : Introduction to dplyr

The assignment utilizes a directory of data called specdata which can be downloaded here , and describes it:

The zip file contains 332 comma-separated-value (CSV) files containing pollution monitoring data for fine particulate matter (PM) air pollution at 332 locations in the United States. Each file contains data from a single monitor and the ID number for each monitor is contained in the file name. For example, data for monitor 200 is contained in the file “200.csv”. Each file contains three variables:
Date : the date of the observation in YYYY-MM-DD format (year-month-day) sulfate : the level of sulfate PM in the air on that date (measured in micrograms per cubic meter) nitrate : the level of nitrate PM in the air on that date (measured in micrograms per cubic meter)
For this programming assignment you will need to unzip this file and create the directory ‘specdata’. Once you have unzipped the zip file, do not make any modifications to the files in the ‘specdata’ directory. In each file you’ll notice that there are many days where either sulfate or nitrate (or both) are missing (coded as NA). This is common with air pollution monitoring data in the United States.
Write a function named ‘pollutantmean’ that calculates the mean of a pollutant (sulfate or nitrate) across a specified list of monitors. The function ‘pollutantmean’ takes three arguments: ‘directory’, ‘pollutant’, and ‘id’. Given a vector monitor ID numbers, ‘pollutantmean’ reads that monitors’ particulate matter data from the directory specified in the ‘directory’ argument and returns the mean of the pollutant across all of the monitors, ignoring any missing values coded as NA. A prototype of the function is as follows

Before we tackle the function, I believe the best approach is to first solve the problem in a regular script. This problem has four clear steps:

  • Identify files in the directory
  • Subset files based on provided ID
  • Read the files
  • Calculate and return the mean on the desired column

This problem gives us a directory of files from which we need to read in the data based on the provided IDs. For the sake of this walk through we will randomly sample 10 values within the range designated in the problem statement (332).

We will first generate random IDs, then identify all of the files within the specified directory and obtain their file paths using the list.files() function. After this we will subset our file list based on the IDs, then iterate over our file list and read in each file as a csv using purrr:map_df() combined with readr::read_csv() . Fortunately map_df() returns a nice and pretty data frame which lets us avoid having to explicitly bind each unique data frame.

Identify Files

Here we create 10 random IDs and store them in the ids variable. Next we use list.files() to look within the specdata folder that we downloaded above. Everyone’s path will most likely be different. Be sure to obtain the correct file path—help for Mac .

Next we identify the files we need based on the sampled ids and store the subset in the files_filtered variable. We use the values of the ids to locate the file paths positionally. For example, ID number 1 is the first file, number 10 is the tenth, etc.

Reading the Files

Now that we have identified the files that we are going to read in, we can use purrr:map_df() to apply the readr::read_csv() function to each value of files_filtered and return a data frame (hence the _df() suffix). We supply additional arguments to read_csv() to ensure that every column is read in properly.

Next, we get to utilize some dplyr magic. Here we take the specdata object we created from reading in our files, deselct the Date column, then utilize summarise_if() to apply the mean() function to our data. summarise_if() requires that we provide a logical statement as the first argument. If (hence the _if() suffix) the logical statement evaluates to TRUE on a column then it will apply a list of functions to those columns where the statement evaluated to TRUE . We can also specify additional arguments to the functions. Here we specify na.rm = TRUE for handling missing values.

In this case, we are checking to see if our columns are of the data type double using the is.double() function. If you’re wondering why we didn’t use is.numeric() , it’s because the ID column is an integer which is considered numeric.

If we wanted to take the underlying vector of one of the columns, we can also, use dplyr::pull(col_name) . This will be helpful later when we want to obtain the mean of just one column.

Now that we have all of the tools, we can put this together into a single function, which I will call pollutant_mean() to somewhat adhere—functions should take the name of verbs—to the tidyverse style guide.

Here we have three arguments:

  • directory : Where to look for the files
  • This needs to be a character value unless we want to get into tidyeval , which frankly I will leave to the professionals. But I will provide an alternative solution at the end that doesn’t require quoted pollutant names.
  • id : Which monitoring stations we should look at

Within the function we take everything we did in the above steps but generalize it to a function. We identify the files in the directory provided ( specdata ), subset the files positionally based on the provided id vector, and then iterate over the file names and read them in with map_df() and read_csv() .

Next we take our data and calculate the mean on both sulfate and nitrate columns. We then pull() the specified column from the pollutant argument and then return() that value.

Here we can test out the function with both types of pollutants and different id values.

Let us continue to the second problem in the problem set.

Write a function that reads a directory full of files and reports the number of completely observed cases in each data file. The function should return a data frame where the first column is the name of the file and the second column is the number of complete cases.

The assignment provides an example function format, but I think it to be a bit misleading. So I will go about this in the way I think is best. We will work on creating a function called complete_spec_cases() which will take only two arguments, directory , and id . directory and id will be used in the the same way as the previous problem.

For this problem our goal is to identify how many complete cases there are by provided ID. This should be exceptionally simple. We will have to identify our files, subset them, and read them in the same way as before. Next we can identify complete cases by piping our specdata object to na.omit() which will remove any row with a missing value. Next, we have to group by the ID column and pipe our grouped data frame to count() which will count how many observations there are by group. We will then return this data frame to the user.

This final problem is probably the most complicated, but with the method we just used above and with a bit more help from the purrr and dplyr packages, we can do this no problem.

Write a function that takes a directory of data files and a threshold for complete cases and calculates the correlation between sulfate and nitrate for monitor locations where the number of completely observed cases (on all variables) is greater than the threshold. The function should return a vector of correlations for the monitors that meet the threshold requirement. If no monitors meet the threshold requirement, then the function should return a numeric vector of length 0. A prototype of this function follows:

Let keep this simple. The above statement essentially is asking that we find the correlation between nitrate and sulfate for each monitoring station (ID). But there is a catch! Each ID must meet a specified threshold of complete cases, and if none of the monitors meet the requirement the function must return a numeric(0) .

The way we will structure this function will be to first read in the data—as we have done twice now, except this time there will be no subsetting of IDs. Then we need to identify the number of complete cases by ID—as we did in problem 2—and identify the stations that meet the threshold requirement. At this point we will use an if statement to check if we have at least 1 monitoring station that meets our threshold, if we do not, we return the numeric(0) —there is most likely a more tidy way to do this, but I am not aware. If we have at least 1 monitoring station that meets the specified threshold we will use an inner_join() to make sure that specdata contains only those IDs that meet the requirement.

For the sake of this example, we will continue to use the specdata object we created in previous examples, and we will set our threshold to 100. Once we identify the stations with the proper number of counts ( > 100 ), we will store that data frame in an object called id_counts

This is where it gets kind of funky. Once we have filtered down our data set, we need to calculate the correlations for each ID. The way that we do this is by nesting our data frame on the ID column. Calling nest(-ID) allows us to, for each value of ID, create a data frame for just those rows where the ID is the same. We will then have a new list type column where each value is actually a data frame. Let’s check out what this looks like before we hop into the function.

Now that we know how to nest our data, we need to calculate the correlations for each row (ID value). We will do this by combining mutate() and map() . Here .x references the data that is within each nested tibble. To learn more about purrr I recommend the chapter on iteration from R For Data Science .

After we have done our calculations we undo our nesting using unnest() on the new column we created, and deselect the data column.

We can now place these above examples within a new function called pollutant_cor() .

We can now test our function against two different thresholds to see how it reacts.

If we set the threshold to 100,000, we should expect a numeric(0) .

It all works!

Pollution is the introduction of harmful materials into the environment. These harmful materials are called pollutants.

Biology, Ecology, Health, Earth Science, Geography

Loading ...

Pollution is the introduction of harmful materials into the environment . These harmful materials are called pollutants . Pollutants can be natural, such as volcanic ash . They can also be created by human activity, such as trash or runoff produced by factories. Pollutants damage the quality of air, water, and land. Many things that are useful to people produce pollution. Cars spew pollutants from their exhaust pipes. Burning coal to create electricity pollutes the air. Industries and homes generate garbage and sewage that can pollute the land and water. Pesticides —chemical poisons used to kill weeds and insects— seep into waterways and harm wildlife . All living things—from one-celled microbes to blue whales—depend on Earth ’s supply of air and water. When these resources are polluted, all forms of life are threatened. Pollution is a global problem. Although urban areas are usually more polluted than the countryside, pollution can spread to remote places where no people live. For example, pesticides and other chemicals have been found in the Antarctic ice sheet . In the middle of the northern Pacific Ocean, a huge collection of microscopic plastic particles forms what is known as the Great Pacific Garbage Patch . Air and water currents carry pollution. Ocean currents and migrating fish carry marine pollutants far and wide. Winds can pick up radioactive material accidentally released from a nuclear reactor and scatter it around the world. Smoke from a factory in one country drifts into another country. In the past, visitors to Big Bend National Park in the U.S. state of Texas could see 290 kilometers (180 miles) across the vast landscape . Now, coal-burning power plants in Texas and the neighboring state of Chihuahua, Mexico have spewed so much pollution into the air that visitors to Big Bend can sometimes see only 50 kilometers (30 miles). The three major types of pollution are air pollution , water pollution , and land pollution . Air Pollution Sometimes, air pollution is visible . A person can see dark smoke pour from the exhaust pipes of large trucks or factories, for example. More often, however, air pollution is invisible . Polluted air can be dangerous, even if the pollutants are invisible. It can make people’s eyes burn and make them have difficulty breathing. It can also increase the risk of lung cancer . Sometimes, air pollution kills quickly. In 1984, an accident at a pesticide plant in Bhopal, India, released a deadly gas into the air. At least 8,000 people died within days. Hundreds of thou sands more were permanently injured. Natural disasters can also cause air pollution to increase quickly. When volcanoes erupt , they eject volcanic ash and gases into the atmosphere . Volcanic ash can discolor the sky for months. After the eruption of the Indonesian volcano of Krakatoa in 1883, ash darkened the sky around the world. The dimmer sky caused fewer crops to be harvested as far away as Europe and North America. For years, meteorologists tracked what was known as the “equatorial smoke stream .” In fact, this smoke stream was a jet stream , a wind high in Earth’s atmosphere that Krakatoa’s air pollution made visible. Volcanic gases , such as sulfur dioxide , can kill nearby residents and make the soil infertile for years. Mount Vesuvius, a volcano in Italy, famously erupted in 79, killing hundreds of residents of the nearby towns of Pompeii and Herculaneum. Most victims of Vesuvius were not killed by lava or landslides caused by the eruption. They were choked, or asphyxiated , by deadly volcanic gases. In 1986, a toxic cloud developed over Lake Nyos, Cameroon. Lake Nyos sits in the crater of a volcano. Though the volcano did not erupt, it did eject volcanic gases into the lake. The heated gases passed through the water of the lake and collected as a cloud that descended the slopes of the volcano and into nearby valleys . As the toxic cloud moved across the landscape, it killed birds and other organisms in their natural habitat . This air pollution also killed thousands of cattle and as many as 1,700 people. Most air pollution is not natural, however. It comes from burning fossil fuels —coal, oil , and natural gas . When gasoline is burned to power cars and trucks, it produces carbon monoxide , a colorless, odorless gas. The gas is harmful in high concentrations , or amounts. City traffic produces highly concentrated carbon monoxide. Cars and factories produce other common pollutants, including nitrogen oxide , sulfur dioxide, and hydrocarbons . These chemicals react with sunlight to produce smog , a thick fog or haze of air pollution. The smog is so thick in Linfen, China, that people can seldom see the sun. Smog can be brown or grayish blue, depending on which pollutants are in it. Smog makes breathing difficult, especially for children and older adults. Some cities that suffer from extreme smog issue air pollution warnings. The government of Hong Kong, for example, will warn people not to go outside or engage in strenuous physical activity (such as running or swimming) when smog is very thick.

When air pollutants such as nitrogen oxide and sulfur dioxide mix with moisture, they change into acids . They then fall back to earth as acid rain . Wind often carries acid rain far from the pollution source. Pollutants produced by factories and power plants in Spain can fall as acid rain in Norway. Acid rain can kill all the trees in a forest . It can also devastate lakes, streams, and other waterways. When lakes become acidic, fish can’t survive . In Sweden, acid rain created thousands of “ dead lakes ,” where fish no longer live. Acid rain also wears away marble and other kinds of stone . It has erased the words on gravestones and damaged many historic buildings and monuments . The Taj Mahal , in Agra, India, was once gleaming white. Years of exposure to acid rain has left it pale. Governments have tried to prevent acid rain by limiting the amount of pollutants released into the air. In Europe and North America, they have had some success, but acid rain remains a major problem in the developing world , especially Asia. Greenhouse gases are another source of air pollution. Greenhouse gases such as carbon dioxide and methane occur naturally in the atmosphere. In fact, they are necessary for life on Earth. They absorb sunlight reflected from Earth, preventing it from escaping into space. By trapping heat in the atmosphere, they keep Earth warm enough for people to live. This is called the greenhouse effect . But human activities such as burning fossil fuels and destroying forests have increased the amount of greenhouse gases in the atmosphere. This has increased the greenhouse effect, and average temperatures across the globe are rising. The decade that began in the year 2000 was the warmest on record. This increase in worldwide average temperatures, caused in part by human activity, is called global warming . Global warming is causing ice sheets and glaciers to melt. The melting ice is causing sea levels to rise at a rate of two millimeters (0.09 inches) per year. The rising seas will eventually flood low-lying coastal regions . Entire nations, such as the islands of Maldives, are threatened by this climate change . Global warming also contributes to the phenomenon of ocean acidification . Ocean acidification is the process of ocean waters absorbing more carbon dioxide from the atmosphere. Fewer organisms can survive in warmer, less salty waters. The ocean food web is threatened as plants and animals such as coral fail to adapt to more acidic oceans. Scientists have predicted that global warming will cause an increase in severe storms . It will also cause more droughts in some regions and more flooding in others. The change in average temperatures is already shrinking some habitats, the regions where plants and animals naturally live. Polar bears hunt seals from sea ice in the Arctic. The melting ice is forcing polar bears to travel farther to find food , and their numbers are shrinking. People and governments can respond quickly and effectively to reduce air pollution. Chemicals called chlorofluorocarbons (CFCs) are a dangerous form of air pollution that governments worked to reduce in the 1980s and 1990s. CFCs are found in gases that cool refrigerators, in foam products, and in aerosol cans . CFCs damage the ozone layer , a region in Earth’s upper atmosphere. The ozone layer protects Earth by absorbing much of the sun’s harmful ultraviolet radiation . When people are exposed to more ultraviolet radiation, they are more likely to develop skin cancer, eye diseases, and other illnesses. In the 1980s, scientists noticed that the ozone layer over Antarctica was thinning. This is often called the “ ozone hole .” No one lives permanently in Antarctica. But Australia, the home of more than 22 million people, lies at the edge of the hole. In the 1990s, the Australian government began an effort to warn people of the dangers of too much sun. Many countries, including the United States, now severely limit the production of CFCs. Water Pollution Some polluted water looks muddy, smells bad, and has garbage floating in it. Some polluted water looks clean, but is filled with harmful chemicals you can’t see or smell. Polluted water is unsafe for drinking and swimming. Some people who drink polluted water are exposed to hazardous chemicals that may make them sick years later. Others consume bacteria and other tiny aquatic organisms that cause disease. The United Nations estimates that 4,000 children die every day from drinking dirty water. Sometimes, polluted water harms people indirectly. They get sick because the fish that live in polluted water are unsafe to eat. They have too many pollutants in their flesh. There are some natural sources of water pollution. Oil and natural gas, for example, can leak into oceans and lakes from natural underground sources. These sites are called petroleum seeps . The world’s largest petroleum seep is the Coal Oil Point Seep, off the coast of the U.S. state of California. The Coal Oil Point Seep releases so much oil that tar balls wash up on nearby beaches . Tar balls are small, sticky pieces of pollution that eventually decompose in the ocean.

Human activity also contributes to water pollution. Chemicals and oils from factories are sometimes dumped or seep into waterways. These chemicals are called runoff. Chemicals in runoff can create a toxic environment for aquatic life. Runoff can also help create a fertile environment for cyanobacteria , also called blue-green algae . Cyanobacteria reproduce rapidly, creating a harmful algal bloom (HAB) . Harmful algal blooms prevent organisms such as plants and fish from living in the ocean. They are associated with “ dead zones ” in the world’s lakes and rivers, places where little life exists below surface water. Mining and drilling can also contribute to water pollution. Acid mine drainage (AMD) is a major contributor to pollution of rivers and streams near coal mines . Acid helps miners remove coal from the surrounding rocks . The acid is washed into streams and rivers, where it reacts with rocks and sand. It releases chemical sulfur from the rocks and sand, creating a river rich in sulfuric acid . Sulfuric acid is toxic to plants, fish, and other aquatic organisms. Sulfuric acid is also toxic to people, making rivers polluted by AMD dangerous sources of water for drinking and hygiene . Oil spills are another source of water pollution. In April 2010, the Deepwater Horizon oil rig exploded in the Gulf of Mexico, causing oil to gush from the ocean floor. In the following months, hundreds of millions of gallons of oil spewed into the gulf waters. The spill produced large plumes of oil under the sea and an oil slick on the surface as large as 24,000 square kilometers (9,100 square miles). The oil slick coated wetlands in the U.S. states of Louisiana and Mississippi, killing marsh plants and aquatic organisms such as crabs and fish. Birds, such as pelicans , became coated in oil and were unable to fly or access food. More than two million animals died as a result of the Deepwater Horizon oil spill. Buried chemical waste can also pollute water supplies. For many years, people disposed of chemical wastes carelessly, not realizing its dangers. In the 1970s, people living in the Love Canal area in Niagara Falls, New York, suffered from extremely high rates of cancer and birth defects . It was discovered that a chemical waste dump had poisoned the area’s water. In 1978, 800 families living in Love Canal had to a bandon their homes. If not disposed of properly, radioactive waste from nuclear power plants can escape into the environment. Radioactive waste can harm living things and pollute the water. Sewage that has not been properly treated is a common source of water pollution. Many cities around the world have poor sewage systems and sewage treatment plants. Delhi, the capital of India, is home to more than 21 million people. More than half the sewage and other waste produced in the city are dumped into the Yamuna River. This pollution makes the river dangerous to use as a source of water for drinking or hygiene. It also reduces the river’s fishery , resulting in less food for the local community. A major source of water pollution is fertilizer used in agriculture . Fertilizer is material added to soil to make plants grow larger and faster. Fertilizers usually contain large amounts of the elements nitrogen and phosphorus , which help plants grow. Rainwater washes fertilizer into streams and lakes. There, the nitrogen and phosphorus cause cyanobacteria to form harmful algal blooms. Rain washes other pollutants into streams and lakes. It picks up animal waste from cattle ranches. Cars drip oil onto the street, and rain carries it into storm drains , which lead to waterways such as rivers and seas. Rain sometimes washes chemical pesticides off of plants and into streams. Pesticides can also seep into groundwater , the water beneath the surface of the Earth. Heat can pollute water. Power plants, for example, produce a huge amount of heat. Power plants are often located on rivers so they can use the water as a coolant . Cool water circulates through the plant, absorbing heat. The heated water is then returned to the river. Aquatic creatures are sensitive to changes in temperature. Some fish, for example, can only live in cold water. Warmer river temperatures prevent fish eggs from hatching. Warmer river water also contributes to harmful algal blooms. Another type of water pollution is simple garbage. The Citarum River in Indonesia, for example, has so much garbage floating in it that you cannot see the water. Floating trash makes the river difficult to fish in. Aquatic animals such as fish and turtles mistake trash, such as plastic bags, for food. Plastic bags and twine can kill many ocean creatures. Chemical pollutants in trash can also pollute the water, making it toxic for fish and people who use the river as a source of drinking water. The fish that are caught in a polluted river often have high levels of chemical toxins in their flesh. People absorb these toxins as they eat the fish. Garbage also fouls the ocean. Many plastic bottles and other pieces of trash are thrown overboard from boats. The wind blows trash out to sea. Ocean currents carry plastics and other floating trash to certain places on the globe, where it cannot escape. The largest of these areas, called the Great Pacific Garbage Patch, is in a remote part of the Pacific Ocean. According to some estimates, this garbage patch is the size of Texas. The trash is a threat to fish and seabirds, which mistake the plastic for food. Many of the plastics are covered with chemical pollutants. Land Pollution Many of the same pollutants that foul the water also harm the land. Mining sometimes leaves the soil contaminated with dangerous chemicals. Pesticides and fertilizers from agricultural fields are blown by the wind. They can harm plants, animals, and sometimes people. Some fruits and vegetables absorb the pesticides that help them grow. When people consume the fruits and vegetables, the pesticides enter their bodies. Some pesticides can cause cancer and other diseases. A pesticide called DDT (dichlorodiphenyltrichloroethane) was once commonly used to kill insects, especially mosquitoes. In many parts of the world, mosquitoes carry a disease called malaria , which kills a million people every year. Swiss chemist Paul Hermann Muller was awarded the Nobel Prize for his understanding of how DDT can control insects and other pests. DDT is responsible for reducing malaria in places such as Taiwan and Sri Lanka. In 1962, American biologist Rachel Carson wrote a book called Silent Spring , which discussed the dangers of DDT. She argued that it could contribute to cancer in humans. She also explained how it was destroying bird eggs, which caused the number of bald eagles, brown pelicans, and ospreys to drop. In 1972, the United States banned the use of DDT. Many other countries also banned it. But DDT didn’t disappear entirely. Today, many governments support the use of DDT because it remains the most effective way to combat malaria. Trash is another form of land pollution. Around the world, paper, cans, glass jars, plastic products, and junked cars and appliances mar the landscape. Litter makes it difficult for plants and other producers in the food web to create nutrients . Animals can die if they mistakenly eat plastic. Garbage often contains dangerous pollutants such as oils, chemicals, and ink. These pollutants can leech into the soil and harm plants, animals, and people. Inefficient garbage collection systems contribute to land pollution. Often, the garbage is picked up and brought to a dump, or landfill . Garbage is buried in landfills. Sometimes, communities produce so much garbage that their landfills are filling up. They are running out of places to dump their trash. A massive landfill near Quezon City, Philippines, was the site of a land pollution tragedy in 2000. Hundreds of people lived on the slopes of the Quezon City landfill. These people made their living from recycling and selling items found in the landfill. However, the landfill was not secure. Heavy rains caused a trash landslide, killing 218 people. Sometimes, landfills are not completely sealed off from the land around them. Pollutants from the landfill leak into the earth in which they are buried. Plants that grow in the earth may be contaminated, and the herbivores that eat the plants also become contaminated. So do the predators that consume the herbivores. This process, where a chemical builds up in each level of the food web, is called bioaccumulation . Pollutants leaked from landfills also leak into local groundwater supplies. There, the aquatic food web (from microscopic algae to fish to predators such as sharks or eagles) can suffer from bioaccumulation of toxic chemicals. Some communities do not have adequate garbage collection systems, and trash lines the side of roads. In other places, garbage washes up on beaches. Kamilo Beach, in the U.S. state of Hawai'i, is littered with plastic bags and bottles carried in by the tide . The trash is dangerous to ocean life and reduces economic activity in the area. Tourism is Hawai'i’s largest industry . Polluted beaches discourage tourists from investing in the area’s hotels, restaurants, and recreational activities. Some cities incinerate , or burn, their garbage. Incinerating trash gets rid of it, but it can release dangerous heavy metals and chemicals into the air. So while trash incinerators can help with the problem of land pollution, they sometimes add to the problem of air pollution. Reducing Pollution Around the world, people and governments are making efforts to combat pollution. Recycling, for instance, is becoming more common. In recycling, trash is processed so its useful materials can be used again. Glass, aluminum cans, and many types of plastic can be melted and reused . Paper can be broken down and turned into new paper. Recycling reduces the amount of garbage that ends up in landfills, incinerators, and waterways. Austria and Switzerland have the highest recycling rates. These nations recycle between 50 and 60 percent of their garbage. The United States recycles about 30 percent of its garbage. Governments can combat pollution by passing laws that limit the amount and types of chemicals factories and agribusinesses are allowed to use. The smoke from coal-burning power plants can be filtered. People and businesses that illegally dump pollutants into the land, water, and air can be fined for millions of dollars. Some government programs, such as the Superfund program in the United States, can force polluters to clean up the sites they polluted. International agreements can also reduce pollution. The Kyoto Protocol , a United Nations agreement to limit the emission of greenhouse gases, has been signed by 191 countries. The United States, the world’s second-largest producer of greenhouse gases, did not sign the agreement. Other countries, such as China, the world’s largest producer of greenhouse gases, have not met their goals. Still, many gains have been made. In 1969, the Cuyahoga River, in the U.S. state of Ohio, was so clogged with oil and trash that it caught on fire. The fire helped spur the Clean Water Act of 1972. This law limited what pollutants could be released into water and set standards for how clean water should be. Today, the Cuyahoga River is much cleaner. Fish have returned to regions of the river where they once could not survive. But even as some rivers are becoming cleaner, others are becoming more polluted. As countries around the world become wealthier, some forms of pollution increase. Countries with growing economies usually need more power plants, which produce more pollutants. Reducing pollution requires environmental, political, and economic leadership. Developed nations must work to reduce and recycle their materials, while developing nations must work to strengthen their economies without destroying the environment. Developed and developing countries must work together toward the common goal of protecting the environment for future use.

How Long Does It Last? Different materials decompose at different rates. How long does it take for these common types of trash to break down?

  • Paper: 2-4 weeks
  • Orange peel: 6 months
  • Milk carton: 5 years
  • Plastic bag: 15 years
  • Tin can: 100 years
  • Plastic bottle: 450 years
  • Glass bottle: 500 years
  • Styrofoam: Never

Indoor Air Pollution The air inside your house can be polluted. Air and carpet cleaners, insect sprays, and cigarettes are all sources of indoor air pollution.

Light Pollution Light pollution is the excess amount of light in the night sky. Light pollution, also called photopollution, is almost always found in urban areas. Light pollution can disrupt ecosystems by confusing the distinction between night and day. Nocturnal animals, those that are active at night, may venture out during the day, while diurnal animals, which are active during daylight hours, may remain active well into the night. Feeding and sleep patterns may be confused. Light pollution also indicates an excess use of energy. The dark-sky movement is a campaign by people to reduce light pollution. This would reduce energy use, allow ecosystems to function more normally, and allow scientists and stargazers to observe the atmosphere.

Noise Pollution Noise pollution is the constant presence of loud, disruptive noises in an area. Usually, noise pollution is caused by construction or nearby transportation facilities, such as airports. Noise pollution is unpleasant, and can be dangerous. Some songbirds, such as robins, are unable to communicate or find food in the presence of heavy noise pollution. The sound waves produced by some noise pollutants can disrupt the sonar used by marine animals to communicate or locate food.

Media Credits

The audio, illustrations, photos, and videos are credited beneath the media asset, except for promotional images, which generally link to another page that contains the media credit. The Rights Holder for media is the person or group credited.

Illustrators

Educator reviewer, last updated.

March 6, 2024

User Permissions

For information on user permissions, please read our Terms of Service. If you have questions about how to cite anything on our website in your project or classroom presentation, please contact your teacher. They will best know the preferred format. When you reach out to them, you will need the page title, URL, and the date you accessed the resource.

If a media asset is downloadable, a download button appears in the corner of the media viewer. If no button appears, you cannot download or save the media.

Text on this page is printable and can be used according to our Terms of Service .

Interactives

Any interactives on this page can only be played while you are visiting our website. You cannot download interactives.

Related Resources

pep

Find what you need to study

7.1 Introduction to Air Pollution

4 min read • january 3, 2023

Joshua Nielsen

Joshua Nielsen

Krish Gupta

https://cdn.pixabay.com/photo/2016/10/19/12/38/industry-1752876_960_720.png

Image Courtesy of Pixabay

Primary Pollutants

Secondary Pollutants

Clean Air Act

Hydrocarbons

Particulates

Coal and Fossil Fuels

The burning of coal and fossil fuels releases many gasses and particles. Coal combustion will release carbon dioxide, sulfur dioxide, metals such as mercury and lead, and particulates . Fossil fuel combustion generates carbon monoxide, nitrogen oxides, sulfur dioxides, hydrocarbons , and particulates

As there are various forms of some of these gasses, they are often referred to as the SOx (sulfur oxides), NOx (nitrogen oxides), and carbon oxides . The small ‘x’ denotes the number of oxygens in the chemical formula.

There are other sources of air pollutants such as factories, volcanoes, and campfires. They produce most of the same gasses and particulates as coal and fossil fuels.

Primary and Secondary Pollutants

Many of the gasses undergo changes and are therefore referred to as either primary or secondary pollutants . Primary pollutants are those that are emitted directly from a source. Primary sources include internal combustion vehicles, wildfires, factories, coal-burning power plants, agriculture, and volcanoes.

Secondary pollutants have undergone a change from a primary pollutant. These changes are often due to the gasses interacting with water vapor and/or sunlight.  Smog and acid precipitation are both examples of secondary pollutants .

Carbon monoxide (CO) is a colorless and odorless gas that is produced by the incomplete burning of fossil fuels, such as gasoline and natural gas. It is a primary pollutant that can have serious health effects, including headaches, dizziness, and nausea. In severe cases, it can lead to coma and death.

Nitric oxide (NO) is a gas that is produced by the burning of fossil fuels and the reaction of nitrogen and oxygen in the atmosphere. It is a primary pollutant that can contribute to the formation of ground-level ozone and particulate matter.

Nitrogen dioxide (NO2) is a gas that is produced by the burning of fossil fuels and the reaction of nitrogen and oxygen in the atmosphere. It is a primary pollutant that can contribute to the formation of ground-level ozone and particulate matter. It can also have adverse effects on human health, including respiratory problems.

Sulfur dioxide (SO2) is a gas that is produced by the burning of fossil fuels that contain sulfur, such as coal and oil. It is a primary pollutant that can contribute to the formation of particulate matter and acid rain. It can also have adverse effects on human health, including respiratory problems.

Ammonia (NH3) is a gas that is produced by the breakdown of organic matter and the use of fertilizers. It is a primary pollutant that can contribute to the formation of particulate matter and the degradation of air quality. It can also have adverse effects on human health, including respiratory problems.

Volatile organic compounds (VOCs) are organic compounds that evaporate easily at room temperature and can contribute to air pollution. They are emitted by a variety of sources, including industrial processes, paints, and cleaning products. VOCs are a primary pollutant that can contribute to the formation of ground-level ozone and particulate matter. They can also have adverse effects on human health, including respiratory problems and cancer.

Particulate matter (PM) is a mixture of solid particles and liquid droplets that are suspended in the air. It is a primary pollutant that can have adverse effects on human health, including respiratory problems and cardiovascular disease. PM can be emitted by a variety of sources, including power plants, industrial processes, and transportation. It is classified by size, with PM10 being particles that are 10 micrometers or smaller in diameter, and PM2.5 being particles that are 2.5 micrometers or smaller in diameter. PM2.5 is particularly harmful because it is small enough to be inhaled and can penetrate deep into the respiratory system.

Sulfur trioxide (SO3) is a gas that is produced by the burning of fossil fuels that contain sulfur, such as coal and oil. It can react with water vapor in the atmosphere to form sulfuric acid, which is a secondary pollutant.

Sulfuric acid (H2SO4) is a strong acid that is produced by the reaction of sulfur trioxide with water vapor in the atmosphere. It is a secondary pollutant that can contribute to the formation of particulate matter and acid rain.

Nitric acid (HNO3) is a strong acid that is produced by the reaction of nitrogen dioxide with water vapor in the atmosphere. It is a secondary pollutant that can contribute to the formation of particulate matter and acid rain.

Ozone (O3) is a gas that is produced by the reaction of nitrogen oxides and volatile organic compounds in the presence of sunlight. It is a secondary pollutant that can have adverse effects on human health, including respiratory problems.

Ammonium (NH4) is a compound that is produced by the reaction of ammonia with acids in the atmosphere. It is a secondary pollutant that can contribute to the formation of particulate matter.

Particulate matter (PM) is described above.

Air Quality

Air quality is affected by the amounts of various gasses and particulates found in the atmosphere. These pollutants may cause brown or grey smog, ozone warnings, or acid precipitation.

The Clean Air Act was passed in 1963 in order to control what is released into the air. It has since gone through many changes. It is largely responsible for the reduction of lead in the atmosphere and currently helps to reduce acid rain and protect the ozone layer. 

Watch: AP Environmental Science - Air Pollution

Key Terms to Review ( 21 )

Ammonia (NH3)

Ammonium (NH4)

Carbon Monoxide (CO)

Nitric acid (HNO3)

Nitric oxide (NO)

Nitrogen Dioxide (NO2)

Sulfur Dioxide (SO2)

Sulfur trioxide (SO3)

Sulfuric acid (H2SO4)

Volatile organic compounds (VOCs)

Fiveable

Stay Connected

© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.

  • [Programming Assignment 1] R Programming
  • by Anderson Hitoshi Uyekita
  • Last updated almost 2 years ago
  • Hide Comments (–) Share Hide Toolbars

Twitter Facebook Google+

Or copy & paste this link into an email or IM:

R Programming Assignment 1: Air Pollution

Introduction.

For this first programming assignment you will write three functions that are meant to interact with dataset that accompanies this assignment. The dataset is contained in a zip file specdata.zip that you can download from the Coursera web site.

The zip file containing the data can be downloaded here:

  • specdata.zip [2.4MB]

The zip file contains 332 comma-separated-value (CSV) files containing pollution monitoring data for fine particulate matter (PM) air pollution at 332 locations in the United States. Each file contains data from a single monitor and the ID number for each monitor is contained in the file name. For example, data for monitor 200 is contained in the file “200.csv”. Each file contains three variables:

Date: the date of the observation in YYYY-MM-DD format (year-month-day)

sulfate: the level of sulfate PM in the air on that date (measured in micrograms per cubic meter)

nitrate: the level of nitrate PM in the air on that date (measured in micrograms per cubic meter)

For this programming assignment you will need to unzip this file and create the directory ‘specdata’. Once you have unzipped the zip file, do not make any modifications to the files in the ‘specdata’ directory. In each file you’ll notice that there are many days where either sulfate or nitrate (or both) are missing (coded as NA). This is common with air pollution monitoring data in the United States.

Write a function named ‘pollutantmean’ that calculates the mean of a pollutant (sulfate or nitrate) across a specified list of monitors. The function ‘pollutantmean’ takes three arguments: ‘directory’, ‘pollutant’, and ‘id’. Given a vector monitor ID numbers, ‘pollutantmean’ reads that monitors’ particulate matter data from the directory specified in the ‘directory’ argument and returns the mean of the pollutant across all of the monitors, ignoring any missing values coded as NA. A prototype of the function is as follows

You can see some example output from this function . The function that you write should be able to match this output. Please save your code to a file named pollutantmean.R .

Write a function that reads a directory full of files and reports the number of completely observed cases in each data file. The function should return a data frame where the first column is the name of the file and the second column is the number of complete cases. A prototype of this function follows

You can see some example output from this function . The function that you write should be able to match this output. Please save your code to a file named complete.R . To run the submit script for this part, make sure your working directory has the file complete.R in it.

Write a function that takes a directory of data files and a threshold for complete cases and calculates the correlation between sulfate and nitrate for monitor locations where the number of completely observed cases (on all variables) is greater than the threshold. The function should return a vector of correlations for the monitors that meet the threshold requirement. If no monitors meet the threshold requirement, then the function should return a numeric vector of length 0. A prototype of this function follows

For this function you will need to use the ‘cor’ function in R which calculates the correlation between two vectors. Please read the help page for this function via ‘?cor’ and make sure that you know how to use it. You can see some example output from this function . The function that you write should be able to match this output. Please save your code to a file named corr.R . To run the submit script for this part, make sure your working directory has the file corr.R in it.

My Solution

pollutantmean.R:

complete.R:

Screenshots

I am learning:

Work out the final solution:

I am really exciting when finishing this programming assignment!

xmuxiaomo

  • 1. Introduction
  • 6.1. Part 1
  • 6.2. Part 2
  • 6.3. Part 3
  • 8. Screenshots

Programming Assignment 1: Air Pollution

My code repository for coursera data science specialization by john hopkins university, introduction.

For this assignment I had to write three functions that are meant to interact with dataset that accompanies this assignment.

Dataset link - specdata.zip

The zip file contains 332 comma-separated-value (CSV) files containing pollution monitoring data for fine particulate matter (PM) air pollution at 332 locations in the United States. Each file contains data from a single monitor and the ID number for each monitor is contained in the file name. For example, data for monitor 200 is contained in the file “200.csv”. Each file contains three variables:

  • Date: the date of the observation in YYYY-MM-DD format (year-month-day)
  • sulfate: the level of sulfate PM in the air on that date (measured in micrograms per cubic meter)
  • nitrate: the level of nitrate PM in the air on that date (measured in micrograms per cubic meter)

Part 1 - pollutantmean.R

Write a function named ‘pollutantmean’ that calculates the mean of a pollutant (sulfate or nitrate) across a specified list of monitors. The function ‘pollutantmean’ takes three arguments: ‘directory’, ‘pollutant’, and ‘id’. Given a vector monitor ID numbers, ‘pollutantmean’ reads that monitors’ particulate matter data from the directory specified in the ‘directory’ argument and returns the mean of the pollutant across all of the monitors, ignoring any missing values coded as NA. A prototype of the function is as follows

Part 2 - complete.R

Write a function that reads a directory full of files and reports the number of completely observed cases in each data file. The function should return a data frame where the first column is the name of the file and the second column is the number of complete cases. A prototype of this function follows

Part 3 - corr.R

Write a function that takes a directory of data files and a threshold for complete cases and calculates the correlation between sulfate and nitrate for monitor locations where the number of completely observed cases (on all variables) is greater than the threshold. The function should return a vector of correlations for the monitors that meet the threshold requirement. If no monitors meet the threshold requirement, then the function should return a numeric vector of length 0. A prototype of this function follows

FREE K-12 standards-aligned STEM

curriculum for educators everywhere!

Find more at TeachEngineering.org .

  • TeachEngineering
  • Linking Sources and Pollutants

Hands-on Activity Linking Sources and Pollutants

Grade Level: 11 (9-12)

Time Required: 45 minutes

This activity uses one or two non-expendable (reusable) air quality monitors, which can be rented; see the Materials List and Other sections for details.

Group Size: 4

Activity Dependency: An Introduction to Air Quality Research

Subject Areas: Earth and Space, Science and Technology

Curriculum in this Unit Units serve as guides to a particular content or subject area. Nested under units are lessons (in purple) and hands-on activities (in blue). Note that not all lessons and activities will exist under a unit, and instead may exist as "standalone" curriculum.

  • Combustion and Air Quality: Emissions Monitoring
  • Study Design for Air Quality Research
  • Understanding the Air through Data Analysis
  • Communicating Your Project Results with Professional Posters

TE Newsletter

Engineering connection, learning objectives, materials list, worksheets and attachments, more curriculum like this, pre-req knowledge, introduction/motivation, vocabulary/definitions, troubleshooting tips, activity extensions, activity scaling, additional multimedia support, user comments & tips.

Engineering… designed to work wonders

During this activity, students investigate as if they were engineers, probing the link between sources and pollutants. By examining what pollutants are present in the air as well as possible sources, environmental engineers can determine where pollution is coming from, which is the first step towards control or mitigation strategies. Students also benefit from the hands-on learning practice of beginning with an action—measuring the gases—and then seeing the data plotted on a screen. In this way, students (and engineers) make the invisible visible and quantifiable.

After this activity, students should be able to:

  • Explain the different sources of CO 2 (biological and combustion), VOCs (combustion and volatilization), and NO 2 (combustion).
  • Use a simple air quality monitor (such as a Pod) to collect data.
  • Analyze and interpret data qualitatively using plots.

Educational Standards Each TeachEngineering lesson or activity is correlated to one or more K-12 science, technology, engineering or math (STEM) educational standards. All 100,000+ K-12 STEM standards covered in TeachEngineering are collected, maintained and packaged by the Achievement Standards Network (ASN) , a project of D2L (www.achievementstandards.org). In the ASN, standards are hierarchically structured: first by source; e.g. , by state; within source by type; e.g. , science or mathematics; within type by subtype, then by grade, etc .

Ngss: next generation science standards - science.

View aligned curriculum

Do you agree with this alignment? Thanks for your feedback!

Common Core State Standards - Math

International technology and engineering educators association - technology, state standards, colorado - science.

Each group needs:

  • pens or pencils
  • Student Data Sheet , one per student
  • Everyday Exposure Worksheet , one per student
  • (optional) Connecting to the Big Picture Handout , one per student

To share with the entire class:

  • 2 air quality monitors, such as a rented AQ-IQ Kit (containing 2 Pods, which are low-cost air quality monitors) from the University of Colorado Boulder, or another low-cost monitor with multiple gas-phase sensors; see the Other section for details on obtaining the Pod or alternate monitors
  • pollutant sources; for a class of 28 students, provide about 10 items (2 of each pollutant type) that give off combustion byproducts or VOCs, such as lighters, candles, rubbing alcohol, wooden coffee stir sticks to burn, super glue, a Bunsen burner to burn natural gas, human breath, etc.
  • safety glasses, enough for two teams of students testing with the two Pods
  • computer and projector, for the teacher to plot and display class data

Basic air quality background information on gas-phase pollutants and some of their sources, such as provided in the associated lesson, An Introduction to Air Quality Research .

Now you have the chance to test out what you learned about air quality monitoring during the associated lesson. Do you remember how we talked about what is in a cloud of smoke billowing from a diesel semi-truck? We know the emissions include carbon dioxide, but can we see it? (Listen to student responses.) No, because it is an invisible gas, right? Remember, all we can see is the particulates, and on cold days, the water vapor.

Today we will use air quality monitors in order to “see” some of the gases that we have discussed. In your groups, you will choose one item from an assortment of possible pollution sources, predict how the sensors will respond, and then we will plot all the data and discuss as a class what happened.

Teacher Tips

Familiarize yourself with the air quality monitor you will be using and how to view data from it. If using a Pod air quality monitor, go through the user manual to understand how to run the monitors and check the data. It is a good idea to practice these steps before using the monitors with your class. The associated lesson, An Introduction to Air Quality Research , provides sufficient scientific background for teaching this activity.

Before the Activity

  • Gather tools and supplies—the air quality monitors and pollutant sources.
  • Make copies of the Student Data Sheet and Everyday Exposure Worksheet . The data sheet guides students through the experimental portion of the lab. The worksheet is suitable for students to complete during the 10-15 minutes when the teacher downloads and plots the data, or as a homework assignment. If you did not use the Connecting to the Big Picture Handout as a homework assignment with the associated lesson , you may want to also make copies of this handout and assign it as homework at activity end.
  • If using a Pod, plug it in for 30 minutes prior to the activity to allow the sensors to warm up. Following the user instructions, practice taking, downloading and plotting some sensor data once before class, to make sure everything works.
  • Set up a computer with a projector to display the plotted data for a class discussion.
  • The procedures below describe doing the entire activity during one class period (collecting, plotting and analyzing Pod air quality monitor sensor data). Alternatively, you could split the activity between two class periods, which gives the teacher time to download and plot the data between class periods (takes 10-15 minutes), and then use the second class period to focus us on a class discussion of the results and data sheet reflection question completion.

With the Students: Experimental Data Collection

  • Hand out the data sheets.
  • Divide the class into groups of four to six students each (adjust accordingly, depending on your class size).
  • Present to the class the Introduction/Motivation content.
  • Direct students to read the instructions on the data sheet, choose the pollution sources they will use and make predictions.
  • Give teams about 10 minutes for discussion and planning time within their groups.
  • Direct groups to start running their sets of three experiments (that is, exposing the pollution sources to the air quality monitors).
  • As needed, assist groups and answer questions while they run their experiments.
  • Assist students with source placement. It is best if sources are placed close to the inlet and a little below, since emissions (particularly from combustion) rise; see Figure 1.
  • Advise students to give the sensors 2-4 minutes to respond to each source.

Three photographs show three items placed right under the same short metal pipe that pokes out from a black case (inlet to the Pod air quality monitor). The items are a votive candle, plastic bottle of rubbing alcohol and a burning wooden coffee stir stick with a flame.

With the Students: Data Plotting and Analysis

  • Download and plot the data from the Pod (allow 10-15 minutes), following the user manual instructions. Do this in front of the entire class. If desired, hand out the worksheet for students to complete while the class data is being downloaded and plotted.
  • Project the data (one Pod at a time) for the entire class to see. Work through the following questions and prompts. Figure 2 provides sample data and is the example referred to below.

A.    Examining one sensor at a time (CO 2 , NO 2 and VOCs), discuss as a class the overall trends. Note that in the Figure 2 example, section 1 is the warm-up period. Possible questions:

  • When was the sensor warming up?
  • When did we begin the activity?
  • Compare the time you started the activity with the time shown in the plot.

B.    Look for peaks associated with particular times and ask students what they believe was happening based on the actions recorded on their data sheets. Example questions based on the Figure 2 example data :

  • Can anyone explain this spike in CO 2 that occurs between 12:10 and 12:15? (Answer: This is the spike from breathing on the sensor; we also see a spike in relative humidity at this point, also from breathing.)
  • What was happening at 12:10 vs. 12:15, because the VOC spike appears larger at time 12:10? (Answer: The first spike is from the rubbing alcohol and the second is from burning the wooden coffee stir stick; note that different VOCs and different amounts of VOCs are affecting the difference in sensor response during the two periods.)

C.    Figure 2 provides example data along with explanations of the corresponding activities that generated that data. All of these plots were generated by uploading the raw data file to the plotting software. Note that the raw NO 2 sensor signal responds inversely, so expect to see a dip in the raw signal if NO 2 is present. Additional Figure 2 explanatory notes:

  • Phase 1: Shows data from when the sensor was warming up.
  • Phase 2: Shows data from a burning candle. Notice a small response from the CO 2 , and a matching inverse response from the NO 2 sensor.
  • Phase 3: Shows data from rubbing alcohol fumes. Notice a strong response from the VOC sensor, NO 2 is recovering, and no response from the rest of the sensors.
  • Phase 4: Shows data from breathing. Notice a strong response from the CO 2 and RH sensor, while the VOC sensor recovers.
  • Phase 5: Shows data from burning the wooden stir stick. Notice a strong response from CO 2 and NO 2 , small response from RH, and delayed response from the VOC sensor.

A screen capture shows four graphs of data from this activity, along with explanations. Data is plotted to show sensor responses during five phases: sensor warm up (phase 1) and four pollutant sources. Phases 2-5 are: burning tea light (votive) candle = CO2 and NO2; rubbing alcohol = VOC; breathing = CO2 and RH; burning wooden coffee stir stick = CO2, NO2, RH, VOC.

  • After the class-wide discussion, direct students to complete the data table by filling in the “Actual Response” from each sensor, and then answer the Reflection Questions at the end of the data sheet.
  • Assign students a worksheet or handout as homework, as described in the Assessment and Activity Extension sections.

carbon dioxide: A colorless and odorless gas. A gas-phase pollutant. Composed of 1 carbon atom and 2 oxygen atoms. Generated by the respiration of animals and the combustion (burning) of fuels that contain carbon. Abbreviated as CO2.

carbon monoxide: A product of incomplete combustion that is deadly to humans in large quantities.

nitrogen dioxide: A gas-phase compound made of 1 nitrogen atom and 2 oxygen atoms. It is formed during high-temperature combustion from the nitrogen that exists in the air. High-temperature combustion also produces nitrogen monoxide (NO). The sum of the amount of NO and NO2 is the amount of NOx present; in other words NOx is a term that includes both NO and NO2.

particulate matter: Solid or liquid particles suspended in the air.

time series plot: A graph with data plotted over time that is used to evaluate patterns and behavior in data over time. In this activity, students use plots of raw sensor data over time for their analyses.

volatile organic compound: An organic chemical that has a high vapor pressure at ordinary room temperature, such that it volatizes (enters the gas phase) at room temperature and pressure. An example is formaldehyde (CH2O, 1 carbon, 2 hydrogens, and 1 oxygen atom). Abbreviated as VOC. VOCs are also gas-phase compounds. VOCs also include products of incomplete combustion (when a carbon-fuel is not completely burned, resulting in only CO2).

Pre-Activity Assessment

Predictions: Before collecting data, have students complete in their groups the first two columns in the table on the Student Data Sheet —Source and Application Notes, and Predicted Response. Expect this to generate discussion around what pollutants are emitted by each source.

Activity Embedded Assessment

Data Collection & Reflection: During the activity, have students record their data on the Student Data Sheet and then answer the Activity Reflection questions on the sheet. Review the predictions, data, observations and answers on students’ completed data sheets to evaluate their understanding of the experiment concepts, procedure and significance.

Post-Activity Assessment

Informal Class Discussion: Review students’ responses to the Reflection Questions on the Student Data Sheet through an informal class discussion and ask what they learned from the activity.

Everyday Connections: After the activity, assign the Everyday Exposure Worksheet as homework to test students’ application of learned concepts and connect them to their own lives. The worksheet asks students to identify three sources of pollution that they routinely encounter, name the likely pollutants associated with them, and rank them according to the estimated amount of exposure. Alternatively, assign students to complete this worksheet while the teacher is downloading and plotting the data during the activity.

Safety Issues

During this activity, use eye protection, such as safety glasses.

When burning pollutant sources, take precautions such as tying back hair, rolling up long sleeves, conducting the activity under a fume hood if available, not letting flames get out of control, being aware of any smoke, and making sure that everything is completely extinguished.

Avoid inhaling any combustion products or vapors from any pollutant sources.

If students are not careful about source placement near the Pod inlet, or do not leave the sources at the inlet long enough, no response may be recorded by the sensors. Classroom sources are unlikely to overwhelm the sensors, so inform students to not worry about this and be cognizant of getting the emissions into the monitor inlet.

To be prepared for any technical difficulties during class, you may want to conduct the activity on your own and create a set of backup data that you download and plot so it is ready to display. Then, if needed, pull up the sample data and tell students the pollutant sources that you used and have them guess when they occur in the time series plot.

Take-Home Handout: If you did not use the three-question Connecting to the Big Picture Handout as part of the associated lesson, consider using this handout as a homework assignment if you used the Everyday Exposure Worksheet during the downloading/plotting wait time during the activity. The questions are open-ended and intended to prompt students to reflect on connections between what they are learning and everyday life. If students are completing the entire AQ-IQ curriculum, these questions are recommended to help them begin to think about topics they may wish to focus on for their projects. If possible, take 10 minutes at the beginning of the next class period to discuss their answers to these questions.

For more advanced students, let them open the collected Pod data in a text file and import it into Microsoft® Excel®. Using the spreadsheet application, students can plot CO 2 , NO 2 , and VOCs against time. Note that this takes a much longer time, but is possible.

Software to aid in plotting and examining the monitor data is explained in the Pod user manual. All downloads and additional assistance/information are available at https://www.colorado.edu/aqiq/ . Alternatively, use Microsoft® Excel® to plot and visualize the data.

pollutant generate assignment

Students learn the basics about the structure of the Earth’s atmosphere, the types of pollutants that are present in the atmosphere (primary, secondary, gas-phase compounds, particulate matter), and the importance of air quality research. They are also introduced to some engineering concepts such as...

preview of 'An Introduction to Air Quality Research' Lesson

Students are introduced to the concepts of air pollution, air quality, and climate change. The three lesson parts (including the associated activities) focus on the prerequisites for understanding air pollution. First, students use M&M® candies to create pie graphs that express their understanding o...

preview of 'What's Air Got to Do with It? Properties & Quality' Lesson

Other Related Information

AQ-IQ Air Quality Monitor Information

This curriculum was designed to support high school students’ use of a low-cost air quality monitor developed by the Hannigan Lab at the University of Colorado Boulder called a “Pod.” Pods can be rented and shipped from the university; see below for details. Alternatively, many of the activities, including the long-term project, can be completed with other air quality monitors—or no monitor. For example, students can design research projects that utilize existing air quality data instead of collecting their own, which is highly feasible since a great amount of data from around the planet is publically available. In addition, other low-cost monitors could be used instead of the Pods, ranging from purchasable to DIY; see the AQ-IQ unit for a list of options.

Is an air quality monitor needed for this activity?

Yes, this activity requires an air quality monitor such as the Pod, although a substitute monitor (see examples listed on the AQ-IQ unit) could also be used. Essentially you just need the ability to measure multiple pollutants.

Obtaining an AQ-IQ air quality monitor (Pod) from the University of Colorado Boulder

The air quality monitors—called Pods—are available in AQ-IQ Kits that can be rented from the Natural History Museum at the University of Colorado Boulder.

An AQ-IQ Kit is an easily transportable carry-on suitcase-sized container that holds two portable air quality monitors (= 2 Pods), a small laptop for processing data, a comprehensive user manual, and accessories such as power cords and batteries for portable monitoring. The cost is a $10 per week rental fee that supports museum expenses to store and rent the kits. Generally, if students are completing a long-term project, expect to rent a kit for 3-8 weeks.

To find out about the availability of AQ-IQ Kits and shipping options, or to schedule a rental or to rent the kits, contact the museum’s education office at https://www.colorado.edu/cumuseum/programs/schools-and-groups/outreach-materials (a phone number and email address are provided). After checking out the kits, the museum can connect you to a mechanical engineering lab at the university as a technical support resource for using the air quality monitors, troubleshooting and conducting student air quality research projects (as needed). Sometimes the lab partners with schools and provides university undergraduate students to assist teachers with technical issues and to mentor and assist high school students throughout their projects. See the AQ-IQ Program website to learn more and to contact them: https://www.colorado.edu/aqiq/ .

Contributors

Supporting program, acknowledgements.

This material is based upon work by the AirWaterGas Sustainability Research Network Education and Outreach Project in the College of Engineering at the University of Colorado Boulder, supported by National Science Foundation grant no. CBET 1240584. However, these contents do not necessarily represent the policies of the National Science Foundation, and you should not assume endorsement by the federal government.

The authors also express their appreciation for the support of the University of Colorado’s Office of Outreach and Engagement.

Last modified: August 22, 2020

A herd of bison moves through a grassy valley in Yellowstone National Park

Earth Day Match: Donate to Defend Our Planet

Drilling on public lands, mass wildlife extinctions, worsening climate change—our planet is in crisis. Help us fight back this Earth Day and your gift will be matched $1 for $1.

Air Pollution: Everything You Need to Know

How smog, soot, greenhouse gases, and other top air pollutants are affecting the planet—and your health.

Smoke blows out of two tall industrial stacks

  • Share this page block

What is air pollution?

What causes air pollution, effects of air pollution, air pollution in the united states, air pollution and environmental justice, controlling air pollution, how to help reduce air pollution, how to protect your health.

Air pollution  refers to the release of pollutants into the air—pollutants that are detrimental to human health and the planet as a whole. According to the  World Health Organization (WHO) , each year, indoor and outdoor air pollution is responsible for nearly seven million deaths around the globe. Ninety-nine percent of human beings currently breathe air that exceeds the WHO’s guideline limits for pollutants, with those living in low- and middle-income countries suffering the most. In the United States, the  Clean Air Act , established in 1970, authorizes the U.S. Environmental Protection Agency (EPA) to safeguard public health by regulating the emissions of these harmful air pollutants.

“Most air pollution comes from energy use and production,” says  John Walke , director of the Clean Air team at NRDC. Driving a car on gasoline, heating a home with oil, running a power plant on  fracked gas : In each case, a fossil fuel is burned and harmful chemicals and gases are released into the air.

“We’ve made progress over the last 50 years in improving air quality in the United States, thanks to the Clean Air Act. But climate change will make it harder in the future to meet pollution standards, which are designed to  protect health ,” says Walke.

Air pollution is now the world’s fourth-largest risk factor for early death. According to the 2020  State of Global Air  report —which summarizes the latest scientific understanding of air pollution around the world—4.5 million deaths were linked to outdoor air pollution exposures in 2019, and another 2.2 million deaths were caused by indoor air pollution. The world’s most populous countries, China and India, continue to bear the highest burdens of disease.

“Despite improvements in reducing global average mortality rates from air pollution, this report also serves as a sobering reminder that the climate crisis threatens to worsen air pollution problems significantly,” explains  Vijay Limaye , senior scientist in NRDC’s Science Office. Smog, for instance, is intensified by increased heat, forming when the weather is warmer and there’s more ultraviolet radiation. In addition, climate change increases the production of allergenic air pollutants, including mold (thanks to damp conditions caused by extreme weather and increased flooding) and pollen (due to a longer pollen season). “Climate change–fueled droughts and dry conditions are also setting the stage for dangerous wildfires,” adds Limaye. “ Wildfire smoke can linger for days and pollute the air with particulate matter hundreds of miles downwind.”

The effects of air pollution on the human body vary, depending on the type of pollutant, the length and level of exposure, and other factors, including a person’s individual health risks and the cumulative impacts of multiple pollutants or stressors.

Smog and soot

These are the two most prevalent types of air pollution. Smog (sometimes referred to as ground-level ozone) occurs when emissions from combusting fossil fuels react with sunlight. Soot—a type of  particulate matter —is made up of tiny particles of chemicals, soil, smoke, dust, or allergens that are carried in the air. The sources of smog and soot are similar. “Both come from cars and trucks, factories, power plants, incinerators, engines, generally anything that combusts fossil fuels such as coal, gasoline, or natural gas,” Walke says.

Smog can irritate the eyes and throat and also damage the lungs, especially those of children, senior citizens, and people who work or exercise outdoors. It’s even worse for people who have asthma or allergies; these extra pollutants can intensify their symptoms and trigger asthma attacks. The tiniest airborne particles in soot are especially dangerous because they can penetrate the lungs and bloodstream and worsen bronchitis, lead to heart attacks, and even hasten death. In  2020, a report from Harvard’s T.H. Chan School of Public Health showed that COVID-19 mortality rates were higher in areas with more particulate matter pollution than in areas with even slightly less, showing a correlation between the virus’s deadliness and long-term exposure to air pollution. 

These findings also illuminate an important  environmental justice issue . Because highways and polluting facilities have historically been sited in or next to low-income neighborhoods and communities of color, the negative effects of this pollution have been  disproportionately experienced by the people who live in these communities.

Hazardous air pollutants

A number of air pollutants pose severe health risks and can sometimes be fatal, even in small amounts. Almost 200 of them are regulated by law; some of the most common are mercury,  lead , dioxins, and benzene. “These are also most often emitted during gas or coal combustion, incineration, or—in the case of benzene—found in gasoline,” Walke says. Benzene, classified as a carcinogen by the EPA, can cause eye, skin, and lung irritation in the short term and blood disorders in the long term. Dioxins, more typically found in food but also present in small amounts in the air, is another carcinogen that can affect the liver in the short term and harm the immune, nervous, and endocrine systems, as well as reproductive functions.  Mercury  attacks the central nervous system. In large amounts, lead can damage children’s brains and kidneys, and even minimal exposure can affect children’s IQ and ability to learn.

Another category of toxic compounds, polycyclic aromatic hydrocarbons (PAHs), are by-products of traffic exhaust and wildfire smoke. In large amounts, they have been linked to eye and lung irritation, blood and liver issues, and even cancer.  In one study , the children of mothers exposed to PAHs during pregnancy showed slower brain-processing speeds and more pronounced symptoms of ADHD.

Greenhouse gases

While these climate pollutants don’t have the direct or immediate impacts on the human body associated with other air pollutants, like smog or hazardous chemicals, they are still harmful to our health. By trapping the earth’s heat in the atmosphere, greenhouse gases lead to warmer temperatures, which in turn lead to the hallmarks of climate change: rising sea levels, more extreme weather, heat-related deaths, and the increased transmission of infectious diseases. In 2021, carbon dioxide accounted for roughly 79 percent of the country’s total greenhouse gas emissions, and methane made up more than 11 percent. “Carbon dioxide comes from combusting fossil fuels, and methane comes from natural and industrial sources, including large amounts that are released during oil and gas drilling,” Walke says. “We emit far larger amounts of carbon dioxide, but methane is significantly more potent, so it’s also very destructive.” 

Another class of greenhouse gases,  hydrofluorocarbons (HFCs) , are thousands of times more powerful than carbon dioxide in their ability to trap heat. In October 2016, more than 140 countries signed the Kigali Agreement to reduce the use of these chemicals—which are found in air conditioners and refrigerators—and develop greener alternatives over time. (The United States officially signed onto the  Kigali Agreement in 2022.)

Pollen and mold

Mold and allergens from trees, weeds, and grass are also carried in the air, are exacerbated by climate change, and can be hazardous to health. Though they aren’t regulated, they can be considered a form of air pollution. “When homes, schools, or businesses get water damage, mold can grow and produce allergenic airborne pollutants,” says Kim Knowlton, professor of environmental health sciences at Columbia University and a former NRDC scientist. “ Mold exposure can precipitate asthma attacks  or an allergic response, and some molds can even produce toxins that would be dangerous for anyone to inhale.”

Pollen allergies are worsening  because of climate change . “Lab and field studies are showing that pollen-producing plants—especially ragweed—grow larger and produce more pollen when you increase the amount of carbon dioxide that they grow in,” Knowlton says. “Climate change also extends the pollen production season, and some studies are beginning to suggest that ragweed pollen itself might be becoming a more potent allergen.” If so, more people will suffer runny noses, fevers, itchy eyes, and other symptoms. “And for people with allergies and asthma, pollen peaks can precipitate asthma attacks, which are far more serious and can be life-threatening.”

pollutant generate assignment

More than one in three U.S. residents—120 million people—live in counties with unhealthy levels of air pollution, according to the  2023  State of the Air  report by the American Lung Association (ALA). Since the annual report was first published, in 2000, its findings have shown how the Clean Air Act has been able to reduce harmful emissions from transportation, power plants, and manufacturing.

Recent findings, however, reflect how climate change–fueled wildfires and extreme heat are adding to the challenges of protecting public health. The latest report—which focuses on ozone, year-round particle pollution, and short-term particle pollution—also finds that people of color are 61 percent more likely than white people to live in a county with a failing grade in at least one of those categories, and three times more likely to live in a county that fails in all three.

In rankings for each of the three pollution categories covered by the ALA report, California cities occupy the top three slots (i.e., were highest in pollution), despite progress that the Golden State has made in reducing air pollution emissions in the past half century. At the other end of the spectrum, these cities consistently rank among the country’s best for air quality: Burlington, Vermont; Honolulu; and Wilmington, North Carolina. 

No one wants to live next door to an incinerator, oil refinery, port, toxic waste dump, or other polluting site. Yet millions of people around the world do, and this puts them at a much higher risk for respiratory disease, cardiovascular disease, neurological damage, cancer, and death. In the United States, people of color are 1.5 times more likely than whites to live in areas with poor air quality, according to the ALA.

Historically, racist zoning policies and discriminatory lending practices known as  redlining  have combined to keep polluting industries and car-choked highways away from white neighborhoods and have turned communities of color—especially low-income and working-class communities of color—into sacrifice zones, where residents are forced to breathe dirty air and suffer the many health problems associated with it. In addition to the increased health risks that come from living in such places, the polluted air can economically harm residents in the form of missed workdays and higher medical costs.

Environmental racism isn't limited to cities and industrial areas. Outdoor laborers, including the estimated three million migrant and seasonal farmworkers in the United States, are among the most vulnerable to air pollution—and they’re also among the least equipped, politically, to pressure employers and lawmakers to affirm their right to breathe clean air.

Recently,  cumulative impact mapping , which uses data on environmental conditions and demographics, has been able to show how some communities are overburdened with layers of issues, like high levels of poverty, unemployment, and pollution. Tools like the  Environmental Justice Screening Method  and the EPA’s  EJScreen  provide evidence of what many environmental justice communities have been explaining for decades: that we need land use and public health reforms to ensure that vulnerable areas are not overburdened and that the people who need resources the most are receiving them.

In the United States, the  Clean Air Act  has been a crucial tool for reducing air pollution since its passage in 1970, although fossil fuel interests aided by industry-friendly lawmakers have frequently attempted to  weaken its many protections. Ensuring that this bedrock environmental law remains intact and properly enforced will always be key to maintaining and improving our air quality.

But the best, most effective way to control air pollution is to speed up our transition to cleaner fuels and industrial processes. By switching over to renewable energy sources (such as wind and solar power), maximizing fuel efficiency in our vehicles, and replacing more and more of our gasoline-powered cars and trucks with electric versions, we'll be limiting air pollution at its source while also curbing the global warming that heightens so many of its worst health impacts.

And what about the economic costs of controlling air pollution? According to a report on the Clean Air Act commissioned by NRDC, the annual  benefits of cleaner air  are up to 32 times greater than the cost of clean air regulations. Those benefits include up to 370,000 avoided premature deaths, 189,000 fewer hospital admissions for cardiac and respiratory illnesses, and net economic benefits of up to $3.8 trillion for the U.S. economy every year.

“The less gasoline we burn, the better we’re doing to reduce air pollution and the harmful effects of climate change,” Walke explains. “Make good choices about transportation. When you can, ride a bike, walk, or take public transportation. For driving, choose a car that gets better miles per gallon of gas or  buy an electric car .” You can also investigate your power provider options—you may be able to request that your electricity be supplied by wind or solar. Buying your food locally cuts down on the fossil fuels burned in trucking or flying food in from across the world. And most important: “Support leaders who push for clean air and water and responsible steps on climate change,” Walke says.

  • “When you see in the news or hear on the weather report that pollution levels are high, it may be useful to limit the time when children go outside or you go for a jog,” Walke says. Generally, ozone levels tend to be lower in the morning.
  • If you exercise outside, stay as far as you can from heavily trafficked roads. Then shower and wash your clothes to remove fine particles.
  • The air may look clear, but that doesn’t mean it’s pollution free. Utilize tools like the EPA’s air pollution monitor,  AirNow , to get the latest conditions. If the air quality is bad, stay inside with the windows closed.
  • If you live or work in an area that’s prone to wildfires,  stay away from the harmful smoke  as much as you’re able. Consider keeping a small stock of masks to wear when conditions are poor. The most ideal masks for smoke particles will be labelled “NIOSH” (which stands for National Institute for Occupational Safety and Health) and have either “N95” or “P100” printed on it.
  • If you’re using an air conditioner while outdoor pollution conditions are bad, use the recirculating setting to limit the amount of polluted air that gets inside. 

This story was originally published on November 1, 2016, and has been updated with new information and links.

This NRDC.org story is available for online republication by news media outlets or nonprofits under these conditions: The writer(s) must be credited with a byline; you must note prominently that the story was originally published by NRDC.org and link to the original; the story cannot be edited (beyond simple things such as grammar); you can’t resell the story in any form or grant republishing rights to other outlets; you can’t republish our material wholesale or automatically—you need to select stories individually; you can’t republish the photos or graphics on our site without specific permission; you should drop us a note to let us know when you’ve used one of our stories.

Related Stories

A city skyline is obscured by thick smog

The Particulars of PM 2.5

An aerial view of floodwaters overtaking a cluster of buildings

What Are the Effects of Climate Change?

Two people walk through a thick haze on a city street

Fossil Fuel Air Pollution Kills One in Five People

When you sign up, you’ll become a member of NRDC’s Activist Network. We will keep you informed with the latest alerts and progress reports.

  • Share full article

Advertisement

Subscriber-only Newsletter

Climate Forward

How to make polluters pay.

A new Vermont bill would create a “climate superfund.”

pollutant generate assignment

By Manuela Andreoni

Around the world, governments, nonprofits and even some everyday people are coming up with strategies to force fossil fuel companies to pay for their contributions to climate change.

The European Union is pushing countries to come up with a global approach , dozens of countries and states have passed taxes on carbon emissions, and a growing number of citizens are filing lawsuits against the oil and gas industry.

But what if governments could simply charge companies for the costs of climate change? These efforts are often described as “climate superfunds,” a reference to the 1980 U.S. law that forced companies to pay for toxic waste cleanup.

At least four states are considering versions of these bills, and tiny Vermont may soon be the first state to pass one. The idea behind the Vermont bill is simple: the state would calculate the damage caused by climate change and charge companies according to the share of emissions they produced.

Vermont’s Senate passed a measure on Tuesday and it will now head toward a vote in the House, where it has support from at least two thirds of members. You may remember that it was one of several states in the Northeast that suffered from devastating floods last summer , killing at least 10 people and causing $2.2 billion in damages .

“Taxpayers alone can’t bear these costs,” said Anthony Iarrapino, a lobbyist who garnered support for the bill for the Conservation Law Foundation. “It’s only fair to look to these immensely profitable corporations whose products and activities are the root causes of the crisis we are in and say, ‘You should pay your fair share and help clean up the mess.’”

What the bill does

We don’t know exactly which companies would be charged under Vermont’s bill, but it would cover companies that produced more than one gigaton of carbon emissions between 1995 and 2024 and have some sort of commercial relationship with the state.

State officials haven’t yet calculated how much money they would raise with the bill, but it’s fair to assume it would be in the hundreds of millions of dollars. A group of U.S. senators calculated a federal climate superfund would raise $500 billion , and New York officials said a statewide measure would collect $30 billion .

“The underlying goal of this bill is not about reducing carbon emissions,” Senator Nader Hashim said on the Vermont Senate floor last week. “This is about reducing the costs for Vermont taxpayers.”

The original Superfund law was signed in 1980, two years after a toxic landfill in Love Canal, a neighborhood of Niagara Falls, N.Y., was recognized as a public threat .

The Vermont bill was inspired by a proposal by a group of U.S. senators, including Sen. Bernie Sanders, in 2021. The national bill did not advance, but it spawned several state-level climate superfund measures. The New York Senate passed a similar bill last year, but because Gov. Kathy Hochul didn’t include it in the budget, it will need to be passed again. Massachusetts and Maryland have also introduced climate superfund bills, and California and Minnesota are expected to do so soon, according to E&E News .

It’s unclear whether Vermont Gov. Phil Scott, a Republican, will sign the measure, though it has had some bipartisan support . Four Republican senators voted to pass the bill on to the House, including one lawmaker who had previously voted against it because he simply didn’t want Vermont to be the first to face off against multibillion dollar corporations in court, a prospect many deem likely.

The oil and gas industry oppose the bill. According to Heatmap , the American Petroleum Institute, a lobbying group, submitted testimony to the Vermont senate warning about the challenge of accurately attributing climate change to specific damages in the state and that emissions by each company can’t be determined accurately enough.

The science that makes it possible

There’s an intrinsic challenge in assessing who should pay for fossil fuel pollution: How do you prove who’s responsible?

Climate change is both global and gradual. Burning fossil fuels in the United States now will impact communities in, say, Africa for years to come. And it’s highly complex — and not always definitive — to link a specific event to climate change.

But attribution science, as the field is known, has made big strides in the last few years.

Scientists have created computer models that contrast our planet to a hypothetical one in which humans didn’t burn fossil fuels . That allows them to know, in a matter of weeks, which disasters can be linked climate change. For example, attribution science told us that the drought in the Amazon rainforest last year was fueled by climate change , but the wildfires in Chile weren’t .

If the climate superfund bill becomes law in Vermont, the state plans to work with scientists to figure out just how much of the damage was caused by climate change. Then, they will calculate what each oil and gas company contributed to it.

For that, they will very likely use a database called “Carbon Majors.” Richard Heede, the climate researcher who created it, told me he has collected thousands of corporate reports from 122 companies across the world detailing how much fossil fuels they have produced in the last decades. Using that, he can calculate a company’s share of global heat-trapping gas emissions.

Another key puzzle piece: The work by researchers and journalists to uncover documents suggesting that fossil fuel companies have known for decades that their activities were harmful to the climate.

Taken together, some Vermont lawmakers believe they have all of the necessary ingredients to make fossil fuel polluters responsible for the damage they’ve caused.

“We can measure just how much worse storms are now because of climate change,” state senator Anne Watson told her colleagues in Vermont. “It’s time for us to hold fossil fuel companies accountable for the damage they have caused.”

Can we engineer our way out of the climate crisis?

On a windswept Icelandic plateau, an international team of engineers and executives is powering up an innovative machine designed to alter the very composition of Earth’s atmosphere.

If all goes as planned, the enormous vacuum will soon be sucking up vast quantities of air, stripping out carbon dioxide and then locking away those greenhouse gases deep underground in ancient stone — greenhouse gases that would otherwise continue heating up the globe.

Just a few years ago, technologies like these, which attempt to re-engineer the natural environment, were on the scientific fringe. They were too expensive, too impractical, too sci-fi. But with the dangers from climate change worsening, and the world failing to meet its goals of slashing greenhouse gas emissions, they are quickly moving to the mainstream among both scientists and investors, despite questions about their effectiveness and safety.

Researchers are studying ways to block some of the sun’s radiation. They are testing whether adding iron to the ocean could carry carbon dioxide to the sea floor. They are hatching plans to build giant parasols in space. And with massive facilities like the one in Iceland, they are seeking to reduce the concentration of carbon dioxide in the air.

As the scale and urgency of the climate crisis has crystallized, “people have woken up and are looking to see if there’s any miraculous deus ex machina that can help,” said Al Gore, the former vice president. — David Gelles

Read the full story here , part of a series on the potentially risky ways humans are starting to manipulate nature to fight climate change. More coverage is coming soon.

More climate news

31 countries have surpassed a pivotal E.V. tipping point, when 5 percent of new car sales are electric , Bloomberg reports.

Solar panels are now so cheap they’re being used as garden fences in Germany and the Netherlands, the Financial Times reports .

Reuters explained how fossil fuels have thrived despite the Biden administration’s efforts to curb climate change .

Civil Eats investigated how Bayer, the agrochemical giant, is pushing for laws to stop pesticide lawsuits across the United States .

Manuela Andreoni is a Times climate and environmental reporter and a writer for the Climate Forward newsletter. More about Manuela Andreoni

Learn More About Climate Change

Have questions about climate change? Our F.A.Q. will tackle your climate questions, big and small .

“Buying Time,” a new series from The New York Times, looks at the risky ways  humans are starting to manipulate nature  to fight climate change.

Big brands like Procter & Gamble and Nestlé say a new generation of recycling plants will help them meet environmental goals, but the technology is struggling to deliver .

The Italian energy giant Eni sees future profits from collecting carbon dioxide and pumping it  into natural gas fields that have been exhausted.

New satellite-based research reveals how land along the East Coast is slumping into the ocean, compounding the danger from global sea level rise . A major culprit: the overpumping of groundwater.

Did you know the ♻ symbol doesn’t mean something is actually recyclable ? Read on about how we got here, and what can be done.

  • CodeQL overview
  • Writing CodeQL queries
  • CodeQL query help documentation »
  • CodeQL query help for JavaScript and TypeScript »

Prototype-polluting assignment ¶

Click to see the query in the CodeQL repository

Most JavaScript objects inherit the properties of the built-in Object.prototype object. Prototype pollution is a type of vulnerability in which an attacker is able to modify Object.prototype . Since most objects inherit from the compromised Object.prototype object, the attacker can use this to tamper with the application logic, and often escalate to remote code execution or cross-site scripting.

One way to cause prototype pollution is by modifying an object obtained via a user-controlled property name. Most objects have a special __proto__ property that refers to Object.prototype . An attacker can abuse this special property to trick the application into performing unintended modifications of Object.prototype .

Recommendation ¶

Use an associative data structure that is resilient to untrusted key values, such as a Map . In some cases, a prototype-less object created with Object.create(null) may be preferable.

Alternatively, restrict the computed property name so it can’t clash with a built-in property, either by prefixing it with a constant string, or by rejecting inputs that don’t conform to the expected format.

In the example below, the untrusted value req.params.id is used as the property name req.session.todos[id] . If a malicious user passes in the ID value __proto__ , the variable items will then refer to Object.prototype . Finally, the modification of items then allows the attacker to inject arbitrary properties onto Object.prototype .

One way to fix this is to use Map objects to associate key/value pairs instead of regular objects, as shown below:

Another way to fix it is to prevent the __proto__ property from being used as a key, as shown below:

References ¶

MDN: Object.prototype. proto

Common Weakness Enumeration: CWE-78 .

Common Weakness Enumeration: CWE-79 .

Common Weakness Enumeration: CWE-94 .

Common Weakness Enumeration: CWE-400 .

Common Weakness Enumeration: CWE-471 .

Common Weakness Enumeration: CWE-915 .

pollutant generate assignment

  • Tiếng Anh (mới)

Mark the letter A, B, C, or D to indicate the word that differs from the other three in the position of primary stress in each of the following questions.

A. familiar

B. generate

C. assignment

D. pollutant

Siêu phẩm 30 đề thi thử THPT quốc gia 2024 do thầy cô VietJack biên soạn, chỉ từ 100k trên Shopee Mall .

verified

Đáp án B

book vietjack

CÂU HỎI HOT CÙNG CHỦ ĐỀ

Mark the letter A, B, C, or D to indicate the word(s) OPPOSITE in meaning to the underlined word(s) in each of the following questions.   If I take the pessimistic viewpoint, Tokyo won't be a safe place to live in.

A. negative

B. optimistic

Mark the letter A, B, C, or D to indicate the word(s) CLOSEST in meaning to the underlined word(s) in each of the following questions. Scientists hope that this new drug will be a major  breakthrough  in the fight against AIDS.

A. new cure

B. important therapy

C. sudden remedy

D. dramatic development

Mark the letter A, B, C, or D to indicate the word(s) CLOSEST in meaning to the underlined word(s) in each of the following questions. They design and carry out projects aiming to reduce fossil fuel consumption, find  renewable  fuels for public transport, and promote other clean air efforts.

A. inexhaustible

B. recyclable

D. environmentally-friendly

Mark the letter A, B, C, or D to indicate the correct response to each of the following exchanges. “What if I quit more than 3 sessions?” – “____”

A. You won't take the final exam.

B. You wouldn't take the final exam.

C. You wouldn't be able to take the final exam.

D. You can't take the final exam.

Mark the letter A, B, C, or D to indicate the correct response to each of the following exchanges. “____” – “London's so big. It took me ages to find my way round.”

A. What about London?

B. What was London?

C. How was London?

D. How about London?

Mark the letter A, B, C, or D to indicate the correct response to each of the following exchanges. “Most cities aren't safe places to live, are they?" – "____”

A. No, I'm afraid. There are always what they call ‘no-go areas'.

B. Yes, they are. There are always what they call ‘no-go areas’.

C. Well, the opposite is true. There are always what they call ‘no-go areas’.

D. On the contrary. There are always what they call ‘no-go areas'.

Mark the letter A, B, C, or D to indicate the correct response to each of the following exchanges. “____” – “Yes, I love it here. Everything I want is only five minutes away.”

A. It's convenient to live here, isn't it?

B. It's comfortable to live here, isn't it?

C. It's inconvenient to live here, isn't it?

D. It's uncomfortable to live here, isn't it?

Hãy Đăng nhập hoặc Tạo tài khoản để gửi bình luận

tailieugiaovien.com.vn

ĐỀ THI LIÊN QUAN

pollutant generate assignment

Gọi 084 283 45 85

Hỗ trợ đăng ký khóa học tại Vietjack

tuyen-dung-giao-vien-1900

CHỌN BỘ SÁCH BẠN MUỐN XEM

Hãy chọn chính xác nhé!

Bạn đã có tài khoản? Đăng nhập

Bằng cách đăng ký, bạn đồng ý với Điều khoản sử dụng và Chính sách Bảo mật của chúng tôi.

Bạn chưa có tài khoản? Đăng ký

Quên mật khẩu

Số điện thoại hiện tại của bạn có vẻ không hợp lệ, vui lòng cập nhật số mới để hể thống kiểm tra lại.

  • Skip to primary navigation
  • Skip to main content
  • Skip to footer

E&E News by POLITICO

7-DAY UNLIMITED ACCESS

EU Green Week 2024 conference – register now!

Towards a water resilient Europe

pollutant generate assignment

Register now for the EU Green Week conference ‘Towards a water resilient Europe’ taking place between 29-30 May in Brussels. 

Water is not just a resource, it is a lifeline for people, the environment, and a sustainable economy. Recent natural disasters have highlighted the importance of ensuring water resilience across Europe. Climate change impacts, decades of mismanagement, and pollution have increased the challenges, calling for collective action. 

The conference will delve into the impacts of these factors and discuss ways to restore and safeguard the disrupted water cycle, address the importance of international cooperation in water-related challenges, debate the access to water and sanitation for all, and more. 

EU Green Week 2024, part of a broader campaign dedicated to water resilience, seeks to stimulate discussions on the present and future of water in Europe. Policymakers, non-governmental organisations, businesses, academia, and citizens will convene to explore solutions and strategies for a water-resilient future. 

Dates : 29-30 May 2024 

Location : Brussels 

Format : On-site and online 

Register for the conference here  

Consult the conference agenda here  

Explore partner events here  

The water debate is not just limited to Brussels. Explore over 200 EU Green Week partner events scheduled across Europe and beyond between 29 May and 1 September 2024. Hosted by educational institutions, environmental, commercial, and non-profit organisations, as well as various levels of public administration, these events align with the theme of water resilience. Take part in seminars, workshops, eco-conscious initiatives, river walks and more!

EU Environment newsletter

Green landscape with person on bike, tree and buildings in the distance.

EU Environment newsletters deliver the latest updates about the European Commission’s environmental priorities straight to your inbox.

Share this page

Introducing Screencastify’s Premium Library!

pollutant generate assignment

We're thrilled to announce an exciting addition to Screencastify that will give you another easy way to create engaging educational video lessons and assignments. Now available in beta for Education users on Pro and School or District plans, our new feature enables teachers to turn any video from YouTube for Education into an interactive video lesson or assignment.

Our Premium Library, paired with our recent updates to Interactive Questions , makes creating video lessons and assessments faster and easier than ever.

Turn YouTube for Education videos into lessons and assignments

Now, you can easily create interactive video lessons and assignments using videos from YouTube for Education, all within Screencastify.

Here's how to use Screencastify's Premium Library to create more engaging, interactive learning experiences:

  • Access videos from YouTube for Education (and in the future—other trusted content providers!) directly inside Screencastify
  • Browse or search videos covering various subjects and grade levels, right inside Screencastify
  • Filter by grade level and subject to find the videos right for you
  • Trim videos to start and end at the relevant points
  • Add short answer or multiple choice questions at the relevant timestamps
  • Share the Screencastify link for students to experience the video in an interactive, ad-safe, trackable way
  • See which students have watched the video
  • Sort responses by question or student to gauge student or class comprehension
  • See who's watched the video and understand how your students are engaging with the content
  • Grade responses and assess student understanding

Share YouTube videos in a safe, ad-free, interactive way

Screencastify's Premium Library allows teachers to share relevant content from YouTube for Education with their students, worry-free. Share only the relevant parts of the video without fear of students experiencing an irrelevant or unsafe ad. Plus, add questions students can't skip to ensure students fully engage with the video.

Bring more diverse voices into the classroom and deepen student understanding

Teachers can now leverage an enormous library of videos from YouTube for Education in their lessons and assignments, allowing them to highlight diverse ways of thinking through problems and understanding concepts.

The Premium Library also empowers teachers to streamline content creation while embracing diversity in the classroom. The ability to leverage a large library of videos from YouTube for Education helps save time in creating lessons. It also brings diverse voices and explanations of concepts into the classroom, enriching the student experience and deepening student understanding.

By incorporating a variety of content from YouTube for Education alongside original teacher-created content, educators can support different student learning styles and make assignments more engaging for students. With such an enormous library of video content now available in the Premium Library and Screencastify's existing Interactive Questions features, it's easy to spark student curiosity and inspire students to engage with new ideas.

Try Screencastify's Premium Library today!

Ready to give it a try? Creating your first interactive YouTube video in Screencastify is just a few clicks away. Now available in beta to our Education users on Pro and School/District plans, purchase a Pro plan or get in touch to get access. Let's make teaching and learning more fun, interactive, and engaging together!

pollutant generate assignment

Here to share updates about Screencastify and help users create better videos.

pollutant generate assignment

Turnitin Logo

Get Started

Setting up your Turnitin classes is easy when you know how. In just four quick steps, learn more about Turnitin's class management tools and how to get your students started. At the end of this tutorial, you can put these simple steps into practice.

1. Create Your Password

You'll need your email address and last name to create your Turnitin account password and set your security information; this information can be found in your welcome email. You can then log into Turnitin and begin customizing your account.

2. Create a Class

The creation of a class is the first step towards using the Turnitin services available to your institution. A Turnitin class groups assignments, helping you to organize student submissions. Once your classes have been created, you can start creating assignments.

  • Click the All Classes tab from any Turnitin page to direct you to the homepage
  • Click the green Add Class button
  • From the Create a new class page, select the class type, and complete the fields marked with an asterisk
  • Select the class end date
  • Click Submit to add your class to Turnitin
  • Once your class has been created, you will be provided with the Class ID and enrollment password, which will allow your students self enroll

3. Create an Assignment

Once your class is ready, it's time to set up your first assignment. A Turnitin assignment forms the basis of accepting student submissions. Once your assignments are set up, you start adding students to your class.

  • Click the relevant class name
  • From your class, click the green Add Assignment button
  • Enter an assignment title
  • Opt to only allow students to submit file types that generate Originality Reports or to allow any file type
  • Next, select your assignment's start date, end date, and post date; the assignment post date is the date from which your students can view your feedback
  • To customize your assignment further, click the optional settings button to reveal an array of options; each option will be accompanied with contextual help icons
  • Click Submit to add your assignment to your Turnitin class

4. Add Students

There are three routes available for adding students. You may find it convenient to add students one by one, or add a large portion of students at once by uploading a list. Alternatively, why not allow your students to enroll themselves at their own pace?

Add Students One by One

You may prefer to use this method when adding fewer than ten students.

  • Click Home from any Turnitin page to direct you to the homepage
  • From the Class homepage, click the Students tab at the top of the page
  • Click the Add Student button to the right
  • Enter the student's first name, last name, and email address
  • Click Submit to add the student

Upload a List of Students

For adding ten students or more, you may find it quicker and easier to upload a list.

  • In a Word™ or plain text file, each student should be written as: first name, last name, email address format with one student per line. In Excel™, separate the first name, last name, and email address into different cells in a column.
  • From the student list, click the Upload List button
  • Click the Choose file button and browse for the plain text, Word™, or Excel™ file that you wish to upload
  • Once the file has uploaded, click the Submit button to upload
  • Check the student details displayed on screen, then click yes, submit to add the students, or no, go back to amend the file

Allow Students to Self-Enroll

Allowing students to self-enroll can save you time.

  • Make a note of the seven-digit Class ID for the class you would like your students to join
  • Next, select the cog icon under Edit
  • From the Edit Class page, make a note of the enrollment password
  • Pass the Class ID and enrollment password to your students
  • Ensure this information is kept safe at all times

Ready to Start Using Turnitin?

Or why not download this page as a PDF for later reading? This information and more is available at guides.turnitin.com !

IMAGES

  1. Global Assessment of Soil Pollution

    pollutant generate assignment

  2. Pollutant

    pollutant generate assignment

  3. PPT

    pollutant generate assignment

  4. Air Pollution Model For Kids

    pollutant generate assignment

  5. Primary and Secondary Pollutants

    pollutant generate assignment

  6. What are the 5 major causes of air pollution?

    pollutant generate assignment

VIDEO

  1. Pollution ll pollutant

  2. Generate Assignment Based Mount Grootberg Report Using Excel

  3. Engg

  4. How to Generate 50 KW Electricity from Biogas using Poultry Litter? मुर्गी की बीट से बिजली बनाए!

  5. 🔥 Pollutant and There Types ||10th Chemistry"🔥||Short Q. # 47 ||CH # 14||Selfdependent Acadamy

  6. Generate Assignment Based Mount Grootberg Report using LMS Data

COMMENTS

  1. GitHub

    \ There are three R files of interest: pollutantmean.R, corr.R, and complete.R.\ ##pollutantmean \ is function that takes three arguments: directory, pollutant, and id.\ the directory is a string with the location of the .csv monitor files\ hint: put all .csv files in same folder with .R files then, set directory=getwd() \ the pollutant is ...

  2. R Programming: Air Pollution

    Assignment Part 1: Write a function named 'pollutantmean' that calculates the mean of a pollutant (sulfate or nitrate) across a specified list of monitors. The function 'pollutantmean' takes three arguments: 'directory', 'pollutant', and 'id'. Given a vector monitor ID numbers, 'pollutantmean' reads that monitors' particulate matter data from ...

  3. Lesson Plans, Teacher Guides and Online Environmental ...

    Acid Rain: A Teacher's Guide (PDF 56 pp, 4.6 MB) Lesson plan and activities from EPA for teachers on acid rain. Grades: 6-8. Type of Resource: Lesson plan. Acid Rain Student Pages. Find the acid rain student pages, as well as general information for older students or adults. Grades: K-12.

  4. Josiah Parry

    The assignment utilizes a directory of data called specdata which can be downloaded here, and describes it: The zip file contains 332 comma-separated-value (CSV) files containing pollution monitoring data for fine particulate matter (PM) air pollution at 332 locations in the United States.

  5. Pollution

    Pollution is the introduction of harmful materials into the environment. These harmful materials are called pollutants. Pollutants can be natural, such as volcanic ash. They can also be created by human activity, such as trash or runoff produced by factories. Pollutants damage the quality of air, water, and land.

  6. AP Environmental Science 2024

    Ammonia (NH3) is a gas that is produced by the breakdown of organic matter and the use of fertilizers. It is a primary pollutant that can contribute to the formation of particulate matter and the degradation of air quality. It can also have adverse effects on human health, including respiratory problems.

  7. RPubs

    [Programming Assignment 1] R Programming; by Anderson Hitoshi Uyekita; Last updated almost 2 years ago; Hide Comments (-) Share Hide Toolbars

  8. R Programming Assignment 1: Air Pollution // 小默的博客

    This is common with air pollution monitoring data in the United States. Part 1. Write a function named 'pollutantmean' that calculates the mean of a pollutant (sulfate or nitrate) across a specified list of monitors. The function 'pollutantmean' takes three arguments: 'directory', 'pollutant', and 'id'.

  9. R-Programming-Assignment1/pollutantmean.R at Coursera

    Atawua / R-Programming-Assignment1 Public. Notifications. Fork 8. Star 1. Projects. Security. Insights. Assignment 1 - Air Pollution. Contribute to Atawua/R-Programming-Assignment1 development by creating an account on GitHub.

  10. Programming Assignment 1: Air Pollution

    The zip file contains 332 comma-separated-value (CSV) files containing pollution monitoring data for fine particulate matter (PM) air pollution at 332 locations in the United States. Each file contains data from a single monitor and the ID number for each monitor is contained in the file name. For example, data for monitor 200 is contained in ...

  11. Pollution Solutions

    Summary. To develop an understanding of modern industrial technologies that clean up and prevent air pollution, students build and observe a variety of simple models of engineering pollutant recovery methods: scrubber, electrostatic precipitator, cyclone and baghouse. In an associated literacy activity, students become more aware of global ...

  12. Linking Sources and Pollutants

    Students use next-generation air quality monitors to measure gas-phase pollutants in the classroom. They apply the knowledge they gained during the associated lesson—an understanding of the connection between air pollutants and their possible sources. Student teams choose three potential pollutant sources and predict how the monitor's ...

  13. Water pollution

    Water pollutants come from either point sources or dispersed sources. A point source is a pipe or channel, such as those used for discharge from an industrial facility or a city sewerage system.A dispersed (or nonpoint) source is a very broad unconfined area from which a variety of pollutants enter the water body, such as the runoff from an agricultural area.

  14. Air Pollution Facts, Causes and the Effects of Pollutants in the Air

    A number of air pollutants pose severe health risks and can sometimes be fatal, even in small amounts. Almost 200 of them are regulated by law; some of the most common are mercury, lead, dioxins ...

  15. G185

    G185 - Chapter 10 Assignment. Match the following air pollutants to their effect on human health: Click the card to flip 👆. - Major component of acid rain (Sulfur dioxide) - Increase eutrophication of surface water (Nitrogen oxides) - Inhibits respiration in animals (Carbon monoxide) - Damages lung tissues and causes cancer (Particulate ...

  16. How to Make Polluters Pay

    State officials haven't yet calculated how much money they would raise with the bill, but it's fair to assume it would be in the hundreds of millions of dollars. A group of U.S. senators ...

  17. Air Pollutant Assignment- Michael Ross.docx

    6. Tropospheric ozone (O3) (aka: ground level ozone) Yes S Sources: Pollution emitted from cars, power plants, industrial boilers, refineries, and chemical plants. Impact: Chest pain, coughing, throat irritation, and congestion. It can worsen bronchitis, emphysema, and asthma. 7. Carbon dioxide (CO2) No S Sources: Natural sources include decomposition, ocean release and respiration.

  18. Atawua/R-Programming-Assignment1: Assignment 1

    R-Programming-Coursera. Assignment 1. "Part 1 - Pollutant Mean" Write a function named 'pollutantmean' that calculates the mean of a pollutant (sulfate or nitrate) across a specified list of monitors. The function 'pollutantmean' takes three arguments: 'directory', 'pollutant', and 'id'. Given a vector monitor ID numbers, 'pollutantmean' reads ...

  19. Prototype-polluting assignment

    Query suites: - javascript-code-scanning.qls. - javascript-security-extended.qls. - javascript-security-and-quality.qls. Click to see the query in the CodeQL repository. Most JavaScript objects inherit the properties of the built-in Object.prototype object. Prototype pollution is a type of vulnerability in which an attacker is able to modify ...

  20. Mark the letter A, B, C, or D familiar generate assignment pollutant

    Hãy Đăng nhập hoặc Tạo tài khoản để gửi bình luận. Mark the letter A, B, C, or D to indicate the word that differs from the other three in the position of primary stress in each of the following questions. A. familiar B. generate C. assignment D. pollutant.

  21. Teachers are using AI to grade essays. Students are using AI to write

    Meanwhile, while fewer faculty members used AI, the percentage grew to 22% of faculty members in the fall of 2023, up from 9% in spring 2023. Teachers are turning to AI tools and platforms ...

  22. White House launches climate-friendly trade task force

    The task force aims to create a global trading system that cuts pollution and prevents buying goods made with weak environmental regulations elsewhere. The White House is standing up a new task ...

  23. R Programming/Programming Assignment 1: Air Pollution ...

    k-hara / pollutantmean.R Public. Notifications. Fork 1. Star 0. master. Cannot retrieve latest commit at this time. 3 Commits.

  24. EU Green Week 2024 conference

    Policymakers, non-governmental organisations, businesses, academia, and citizens will convene to explore solutions and strategies for a water-resilient future. Dates: 29-30 May 2024. Location: Brussels. Format: On-site and online. Register for the conference here. Consult the conference agenda here. Explore partner events here.

  25. Introducing Screencastify's Premium Library!

    Screencastify's Premium Library allows teachers to share relevant content from YouTube for Education with their students, worry-free. Share only the relevant parts of the video without fear of students experiencing an irrelevant or unsafe ad. Plus, add questions students can't skip to ensure students fully engage with the video.

  26. Instructor

    Once your classes have been created, you can start creating assignments. 3. Create an Assignment. Once your class is ready, it's time to set up your first assignment. A Turnitin assignment forms the basis of accepting student submissions. Once your assignments are set up, you start adding students to your class. 4.

  27. GitHub

    'pollutantmean' that calculates the mean of a pollutant (sulfate or nitrate) across a specified list of monitors. The function 'pollutantmean' takes three arguments: 'directory', 'pollutant', and 'id'. Given a vector monitor ID numbers, 'pollutantmean' reads that monitors' particulate matter data from the directory specified in the 'directory' argument and returns the mean of the pollutant ...