Toggle light / dark theme

Automating repetitive tasks with loops and functions.


Many R users get into R programming from a statistics background rather than a programming/software engineering background, having previously used software such as SPSS, Excel etc. As such they may not have an understanding of some of the programming techniques that can be leveraged to improve code. This can include making the code more modular which in turn makes it easier to find and resolve bugs, but also can be used to automate repetitive tasks, such as producing tables and plots etc.

This short post in c ludes some of the basic programming techniques that can be used to improve the quality and maintainability of R scripts. This will also save you a whole lot of time if you are carrying out repetitive tasks that are only marginally different. We assume that you have a basic understanding of writing simple scripts in R.

Let’s start with a simple example. Let’s say we have some data from several different groups. In this case 3 animals (tigers, swans and badgers) and we have collected some data on relating to this (a score and value of some kind).

Every part of the James Webb Space Telescope’s (JWST’s) deployment is nerve-wracking, but some of the most nail-biting moments will happen on New Year’s Eve and New Year’s Day.

We’re on Day 5 of the Webb Telescope’s 30 Days of Terror, and so far, the observatory’s engineering team has successfully checked off all the boxes on its to-do list (get your own check-off list here.)

But starting on December 31 comes the task that is among the most worrisome: unfolding the giant sunshield. The enormous sunshield is about 70 by 47 feet (21 by 14 meters) when deployed, or approximately the size of a tennis court.

Unfortunately, some of the data is lost forever. 🧐

#engineering


A routine backup procedure meant to safeguard data of researchers at Kyoto University in Japan went awry and deleted 77 terabytes of data, Gizmodo reported. The incident occurred between December 14 and 16, first came to light on the 16th, and affected as many as 14 research groups at the university.

Supercomputers are the ultimate computing devices available to researchers as they try to answer complex questions on a range of topics from molecular modeling to oil exploration, climate change models to quantum mechanics, to name a few. Capable of making hundred quadrillion operations a second, these computers are not only expensive to build but also to operate, costing hundreds of dollars for every hour of operation.

According to Bleeping Computer that originally reported the mishap, the university uses Cray supercomputers with the top system employing 122,400 computing cores. The memory on the system though is limited to approximately 197 terabytes and therefore, an Exascaler data storage system is used, which can transfer 150 GB of data per second and store up to 24 petabytes of information.

Defense company Raytheon has clinched a US Navy contract to provide engineering and technical services for the Evolved Seasparrow Missile and NATO Seasparrow Missile programs, the Pentagon has said.

A press release by the Department of Defense on December 30 stated, “Raytheon Company [of] Tucson, Arizona, is awarded a $55,121,826 modification to a previously awarded contract for engineering and technical services in support of the Evolved Seasparrow Missile and NATO Seasparrow Missile Systems programs.”

The contract combines purchases for the US government (99%); and those of Japan and the United Arab Emirates (1%) under the Foreign Military Sales program.

Thyme and oregano possess an anti-cancer compound that suppresses tumor development, but adding more to your tomato sauce isn’t enough to gain significant benefit. The key to unlocking the power of these plants is in amplifying the amount of the compound created or synthesizing the compound for drug development.

Researchers at Purdue University achieved the first step toward using the compound in pharmaceuticals by mapping its biosynthetic pathway, a sort of molecular recipe of the ingredients and steps needed.

“These plants contain important compounds, but the amount is very low and extraction won’t be enough,” said Natalia Dudareva, a Distinguished Professor of Biochemistry in Purdue’s College of Agriculture, who co-led the project. “By understanding how these compounds are formed, we open a path to engineering plants with higher levels of them or to synthesizing the compounds in microorganisms for medical use.

James Webb Tracker! #NASA #WEBB
#JWST #NASA #JamesWebbLaunch.
LIMITED EDITION Launch Commemorative Shirt — www.etsy.com/shop/TheLaunchPadShop.

James Webb Space Telescope launched on Saturday, Dec 25 at 12:20 UTC from Guiana Space Centre. Webb Telescope liftoff aboard Ariane 5 rocket.

James Webb Space Telescope (JWST) is a space telescope being jointly developed by NASA, the European Space Agency, and the Canadian Space Agency. It is planned to succeed the Hubble Space Telescope as NASA’s Flagship astrophysics mission.

With revolutionary technology, Webb will observe a part of space and time never seen before, providing a wealth of amazing views into an era when the very first stars and galaxies formed–over 13.5 billion years ago.

Webb is NASA’s largest and most powerful space science telescope ever constructed. Webb’s enormous size and frigid operating temperature present extraordinary engineering challenges.

After launching from French Guiana, the observatory will travel to an orbit about one million miles away from Earth and undergo six months of commissioning in space—unfolding its mirrors, sunshield, and other smaller systems, cooling down, aligning, and calibrating.

Imagine windows that can easily transform into mirrors, or super high-speed computers that run not on electrons but light. These are just some of the potential applications that could emerge from optical engineering, the practice of using lasers to rapidly and temporarily change the properties of materials.

“These tools could let you transform the electronic properties of materials at the flick of a light switch,” says Caltech Professor of Physics David Hsieh. “But the technologies have been limited by the problem of the lasers creating too much heat in the materials.”

In a new study in Nature, Hsieh and his team, including lead author and graduate student Junyi Shan, report success at using lasers to dramatically sculpt the properties of materials without the production of any excess damaging heat.

While rotating at up to 10 degrees per second!

The technological competition between the United States and China is growing at breakneck speeds.

A small and relatively low-cost satellite by China can allegedly take high-resolution images of cities in mere seconds, The South China Morning Post first reported. The images are allegedly so detailed that they can be used to identify specific military vehicles and weapons.

An impressive act proving this statement was performed by Beijing-3, a small commercial satellite launched by China in June. Beijing-3 conducted an in-depth scan of the San Francisco Bay, which corresponds to roughly 1,470 sq mi (3,800 sq km), within 42 seconds, according to scientists involved in the satellite project who published the results this month in the Chinese peer-reviewed journal Spacecraft Engineering.

Full Story:

It burns about half the fuel of the same-sized rotorcraft.

In 1989, Vox conceptualized fixed-wing vertical take-off and landing airframes (VTOL), along with a plethora of sketches that looked straight out of a sci-fi movie, for a way to innovate the idea. Several prototypes and component tests later, the aircraft is in its final stages of assembly, and testing is expected to start next year.

Revolving around the concept of increasing the safety and convenience of the passenger, this hybrid aircraft can also fly three times faster than a helicopter.

“Our aircraft can travel at turboprop speeds and land on nearly any helipad in the world,” Brian Morgan, the COO and EVP of engineering at Vox, told Robb Report. “Like any helicopter, it provides the flexibility and ease of point-to-point travel, but at two to three times the speed, with more comfort and the ability to fly above the weather, all while burning about half the fuel of the same-sized rotorcraft performing the same mission,” he said.

Full Story: