scuba-package(scuba)
scuba-package()所属R语言包:scuba
The Scuba Package
潜水包装
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This is a summary of the features of scuba, a package in R that performs theoretical calculations about scuba diving — dive profiles, decompression models, gas toxicity and so on.
这是一个总结的特点scuba,包在R关于潜水 - 潜水,减压模型,气体的毒性等进行理论计算。
Details
详细信息----------Details----------
scuba is a package for performing calculations in the theory of scuba diving. The package supports
scuba是包潜水的理论进行计算。该软件包支持
creation, manipulation and plotting of dive profiles
创建,操作和绘制潜水
gas diffusion models
气体扩散模型
decompression calculations
减压计算
gas toxicity calculations.
气体毒性计算。
The scuba package is intended only for use in research and education about the mathematical and statistical basis of decompression theory. It is emphatically not designed for actual use in scuba diving and related activities. See the detailed disclaimer in scuba.disclaimer.
scuba包的目的仅用于研究和教育中的数学和统计的基础上减压理论。它强调为实际使用在潜水和相关活动。请参阅详细免责声明:scuba.disclaimer。
Following is a summary of the main features of the package. For a more detailed explanation, with illustrations, see the vignette Introduction to the Scuba package which accompanies the package.
下面是一个包的主要特点总结。如需更详细的解释,插图,看到的小插曲的潜水包,伴随着包。
潜水----------Dive profiles----------
A dive profile gives the diver's depth as a function of elapsed time during a scuba dive. The command dive creates an object representing a dive profile.
一个的潜水资料给潜水员的深度潜水过程中经过时间的函数。命令dive创建一个对象,表示一个潜水资料。
A dive profile is piecewise linear: it is a series of stages that join successive waypoints. Each waypoint is specified by the depth and elapsed time when it is reached. The stage between two waypoints is either a sojourn at a fixed depth, or an ascent or descent at a constant rate.
潜水配置文件是分段线性,加入连续航点的阶段,它是一个系列。每个航点指定当它达到的深度和所用的时间。两个道路点之间的阶段可以是一个寄居在一个固定的深度,以恒定的速率或上升或下降。
The function dive interprets its arguments as a sequence of actions or events occurring during the dive. If an argument is a vector of length 2, it is interpreted as c(depth,time) specifying the depth and duration of a stage of the dive. If the argument is a single number, it is interpreted as a depth, meaning that the diver ascends or descends to this depth.
的功能dive解释它的参数作为一个序列的行为或事件,发生在潜水过程中。如果一个参数是一个向量,长度为2,它被解释为c(depth,time)指定的一个阶段的潜水深度和持续时间。如果参数是一个单一的数字,它被解释为深度,这意味着潜水员上升或下降到这个深度。
For example, the command d <- dive(c(18, 45)) specifies a dive to 18 metres for 45 minutes. The command d <- dive(c(18, 45), c(5,3)) specifies a dive to 18 metres for 45 minutes followed by a safety stop at 5 metres for 3 minutes. Multilevel dives with any number of stages are specified in the same way. A dive object may include periods spent at the surface (depth zero) and may therefore represent a succession of dives separated by surface intervals. For example, d <- dive(c(30,15),c(9,1),c(5,5),c(0,60),c(12,60),c(5,5)) represents two dives (with safety stops) separated by a one-hour surface interval.
例如中,命令d <- dive(c(18, 45))指定一个下潜到18米45分钟。命令d <- dive(c(18, 45), c(5,3))指定一个潜水45分钟,3分钟的安全停留在5米到18米。多级潜水与任意数量的阶段中指定的相同的方式。潜水的对象可以包括在表面(深度为零)略去的期间,并因此可能代表由表面的间隔分开的潜水继承。例如,d <- dive(c(30,15),c(9,1),c(5,5),c(0,60),c(12,60),c(5,5))表示由一小时的表面间隔分隔的两个潜(安全停止)。
The resulting object d is an object of class "dive". It can be plotted as a conventional dive profile graph by executing the command plot(d). It can be printed as a table of depths and times by typing its name d, or by executing print(d,seconds=FALSE) to print times to the nearest minute. A summary of the dive (with such information as the average depth, maximum depth and the main stages of the dive) can be printed by typing summary(d).
生成的对象d是一个对象的类"dive"。它可以作为一个传统的潜水剖面图绘制执行命令plot(d)。键入它的名字d表的深度和时间,或执行print(d,seconds=FALSE)打印时间为最接近的分钟可以打印。潜水等信息的平均深度,最大深度,潜水的主要阶段的总结,可以打印输入summary(d)。
By default, the function dive fills in some details about the dive. It assumes that the diver breathes compressed air; the dive starts and ends at the surface (depth zero); the diver descends at the default descent rate of 30 metres per minute; and the diver ascends at the default ascent rate of 18 metres per minute. These defaults can be changed by giving extra arguments to the function dive.
默认情况下,该功能dive填充的潜水中的一些细节。 ,潜水员呼吸压缩空气潜水开始和结束的表面(深度为零),潜水员在默认情况下每分钟30米的下降率下降;在默认的上升速度每分钟18米的潜水员上升。这些默认值是可以改变的,给予额外的参数给函数dive。
Dive profiles can also be modified after they are created: see below.
潜水也可以被修改后,他们创建的:见下文。
真正的潜水简介----------Real Dive Profiles----------
Dive profiles may also be uploaded from your dive computer and studied in the scuba package. First convert the uploaded profile data to a data.frame with two columns, the first column containing the elapsed time and the second column containing the depth (in metres) recorded at each time. The elapsed times can be either a vector of character strings in minutes-and-seconds format mm:ss or hours-minutes seconds hh:mm:ss, or a vector of integer times measured in seconds of elapsed time, or an object of class difftime containing the elapsed times in any time unit. Then pass this data frame as an argument to the function dive.
从您的潜水电脑表,潜水也可以上传和研究scuba包。首先上载的配置文件数据转换到一个data.frame有两列,第一列包含的经过时间和记录在每个时间的深度(米)的第二列包含。所经过的时间可以是一个字符串向量分钟和秒的格式mm:ss或小时 - 分钟秒hh:mm:ss,或经过的时间以秒为单位的测得的整数倍,或者对象的矢量类difftime所经过的时间,在任何时间单位。作为参数,然后把这个数据框的功能dive。
An example of such a data frame, uploaded from a dive computer, is provided in the baron dataset supplied with the package. See the help file for baron for an example of how to convert a data frame to a "dive" object.
一个例子的这样的数据框,从潜水计算机上传,设置在baron软件包一起提供的数据集。请参阅帮助文件为baron如何转换的数据框到"dive"对象的一个例子。
The package also provides 11 real dive profiles that have already been converted to "dive" objects. See the help file for pedro.
该软件包还提供了11个真正的潜水分布已经转换为"dive"对象的。请参阅帮助文件pedro。
减压计算----------Decompression Calculations----------
The scuba package performs the mathematical calculations of decompression theory:
scuba包进行解压缩理论的数学计算:
the theoretical No Decompression Limit (maximum duration of a no-decompression dive to a specified depth) can be computed by ndl(depth)
理论免减压极限(最长持续时间不减压潜水到指定的深度)可以计算的ndl(depth)的
the quantity of nitrogen dissolved in the diver's body after a dive d can be computed by haldane(d)
量的氮气溶解在潜水员的身体后潜水d可以计算的haldane(d)的
the quantity of nitrogen dissolved in the diver's body at each instant during a dive d can be computed by haldane(d, progressive=TRUE) or plotted interactively by showstates(d).
量的氮气溶解在潜水员的身体在每一个瞬间,在潜水过程中,d可以计算haldane(d, progressive=TRUE)或绘制交互方式showstates(d)。
These calculations are based on the classical theory of decompression originated by Haldane (Boycott et al, 1908). The diver's body is idealised as a set of independent compartments, each connected directly to the breathing gas, and governed by classical (exponential) diffusion.
这些计算是基于经典理论的减压霍尔丹“(抵制等人,1908年)发起。潜水员的身体被理想化为一组独立的隔室,每个直接连接到呼吸气体,并受经典(指数)扩散。
The model parameters (the number of compartments, their diffusion rates, and the maximum tolerated nitrogen tension in each compartment) may be chosen by the user. By default, the model parameters are taken from the DSAT model which is the basis of the PADI Recreational Dive Planner. Alternatively, the user can choose from a variety of standard compartment models using the command pickmodel, or construct a new model using hm.
可以由用户选择的该模型的参数(的隔室的数目,它们的扩散率,在每个隔室中的张力的最大耐受氮)。默认情况下,模型参数,采取的的DSAT模式,是PADI休闲潜水计划的基础上。另外,用户可以选择从各种标准舱模型,使用命令pickmodel,或使用hm建设的新模式。
No-decompression limits (the maximum duration of a no-decompression dive to a given depth) can be calculated using the function ndl. For example ndl(30) gives the theoretical NDL for a dive to 30 metres, predicted by the DSAT model. To use the classical US Navy model instead, type ndl(30, model="USN") or ndl(30, model=pickmodel("USN")).
无减压极限(最长持续时间不减压潜水到一定的深度),可以计算出使用的功能ndl。例如ndl(30)提供了理论NDL潜水30米,DSAT模型预测的。要,而不是采用传统的美国海军模型,键入ndl(30, model="USN")或ndl(30, model=pickmodel("USN"))。
The "best" double no-decompression dive to given depths d1 and d2 can be calculated by bestdoubledive according to the algorithm of Baddeley and Bassom (2012).
的“最佳”双无减压潜水给定的深处d1和d2可以计算出bestdoubledive根据算法的巴德利和Bassom的(2012年)。
The nitrogen tension (the quantity of dissolved nitrogen, in atmospheres absolute) in the diver's body after a dive, can be calculated using the function haldane. If d is a dive object then haldane(d) returns a data frame containing the nitrogen tissue tensions (ata) at the end of the dive, in each of the 8 tissue compartments of the DSAT model. To use the US Navy model instead, type haldane(d, "USN") or haldane(d, pickmodel("USN")).
潜水的氮张力(溶解氮的量,在绝对大气压)后,在潜水员的身体,可以计算出使用的功能haldane。如果d是潜水对象,然后haldane(d)返回一个数据框中的含氮的组织紧张局势(ATA)在潜水结束,每个组织车厢的DSAT模型的。要使用美国海军模型来代替,键入haldane(d, "USN")或haldane(d, pickmodel("USN"))。
To compute the nitrogen tissue tensions at each waypoint during the dive, use haldane(d, progressive=TRUE).
要计算的氮的组织紧张局势在每个航点在潜水过程中,使用haldane(d, progressive=TRUE)。
To visualise the nitrogen tissue tensions during the dive, use the interactive function showstates. This plots the dive and waits for you to click on a position in the graph. The tissue tensions at that instant are displayed as a bar plot.
可视化的氮组织的紧张局势在潜水过程中,使用互动功能showstates。此图的潜水和等待您点击图中的位置。该组织在那一瞬间的紧张局势,作为条形图显示。
The total oxygen toxicity incurred during a dive can be computed by oxtox.
可以计算出oxtox总氧潜水过程中产生的毒性。
Bubble theory calculations are not yet implemented.
尚未实现的气泡理论计算。
高氧和氦氮氧混合气----------Nitrox and trimix----------
A breathing gas is represented by an object of class "gas". The object air is a representation of compressed air (21% oxygen, 79% nitrogen) as an object of this class. (Don't reassign another value to this object!!!)
呼吸气体所代表的对象类"gas"。对象air是压缩空气中的(21%的氧,79%氮)作为这个类的对象的表示。 (不要重新分配到该对象的另一个值!!)
Nitrox mixtures (mixtures of oxygen and nitrogen) can be represented using the function nitrox. For example, EAN 32 is represented by nitrox(0.32).
氮氧混合物(氧和氮的混合物),可以使用的功能nitrox表示。例如,EAN 32为代表的nitrox(0.32)。
Trimix (a mixture of oxygen, nitrogen and helium) can also be represented, using the command trimix. For example, Trimix 15/50 (containing 15% oxygen, 50% helium and 35% nitrogen) is represented by trimix(0.15, 0.5).
混合气(氧气,氮气和氦气的混合物),也可以被表示使用命令trimix的。例如,15/50(含15%的氧气,50%氦和35%的氮气)的是,混合气的表示的trimix(0.15, 0.5)。
There are methods for print and summary for gas objects.
有print和summary气体对象的方法。
Decompression calculations (haldane, ndl, showstates) also work with nitrox and trimix.
减压计算(haldane,ndl,showstates)也与氮氧混合气。
Decompression calculations with trimix require a Haldane model that includes parameters for Helium diffusion. Use pickmodel("Z") to select the Buehlmann ZH-L16A model, or hm to create a new model that includes Helium diffusion.
混合气的减压计算需要Haldane模型,其中包括氦的扩散参数。使用pickmodel("Z")选择的Buehlmann的ZH-L16A型,或hm创建一个新的模型,其中包括氦的扩散。
Standard nitrox calculations are also available, for example
例如标准氮氧计算的都还可以,
The total oxygen toxicity incurred during a nitrox or trimix dive can be computed by oxtox.
可以计算出oxtox总氧氮氧混合气潜水过程中所产生的毒性。
在不同的气体潜水----------Diving on different gases----------
Every "dive" object contains information about the breathing gas or gases used in the dive. This information is determined when the "dive" object is created (by the function dive). The default breathing gas is air.
每"dive"对象中包含的信息在潜水呼吸气体或气体。信息"dive"对象被创建时确定(由功能dive“)。默认的呼吸气体是空气。
The function dive interprets its arguments as a sequence of actions or events occurring during the dive. If an argument is a vector of length 2, it is interpreted as c(depth,time) specifying the depth and duration of a stage of the dive. If the argument is a single number, it is interpreted as a depth, meaning that the diver ascends or descends to this depth.
的功能dive解释它的参数作为一个序列的行为或事件,发生在潜水过程中。如果一个参数是一个向量,长度为2,它被解释为c(depth,time)指定的一个阶段的潜水深度和持续时间。如果参数是一个单一的数字,它被解释为深度,这意味着潜水员上升或下降到这个深度。
Each argument to dive may also be a "gas" object, like nitrox(0.32), which means that the diver switches to this gas.
每一个参数dive也可能是“气”的对象,像nitrox(0.32),这意味着潜水员切换到这种气体。
So, for example, dive(nitrox(0.32), c(30,20)) means a dive to 30 metres for 20 minutes conducted on EAN 32 (Nitrox 0.32) from start to finish. The command dive(c(30,20), 5, nitrox(0.36), c(5,3)) means a dive on air to 30 metres for 20 minutes, ascending to 5 metres while breathing air, then switching to EAN 36 for a safety stop at 5 metres for 3 minutes.
因此,举例来说,dive(nitrox(0.32), c(30,20))是指从开始到结束潜水20分钟进行EAN 32(高氧0.32米至30米)。命令dive(c(30,20), 5, nitrox(0.36), c(5,3))是指对空气潜水20分钟至30米,上升到5米,而呼吸的空气,然后切换到3分钟的安全停留在5米EAN 36。
Alternatively you can use the argument tanklist to specify a list of tanks of breathing gas (with optional names like "travel" and "deco") and change between tanks at different stages of the dive using an argument of the form tank=number or tank=name. The tank list of a dive object can be extracted using tanklist and modified using tanklist<-.
另外,您可以使用参数tanklist到指定列表中的呼吸气体的坦克(可选的名称,如"travel"和"deco")和使用参数之间的变化在不同阶段的潜水坦克形式tank=number或tank=name。可以提取使用tanklist修改使用tanklist<-,坦克潜水对象列表。
操纵潜水----------Manipulating dive profiles----------
Dive profiles can also be manipulated after they are created. This allows you, for example, to modify the deepest portion of a dive (diving to a deeper depth or for a longer duration), to abort a dive prematurely, to cut-and-paste several dives together, or to consider the tissue saturation incurred by a particular segment of a dive.
在创建后,配置文件也可以被操纵潜水。例如,这允许你修改的最深部的潜水(潜水更深的深度,或更长的时间),中止一个潜水过早,削减和粘贴几个潜水,或考虑组织的饱和度所产生的某一运输区段的潜水。
The commands depths.dive and times.dive extract the depths and elapsed times at each waypoint during the dive. The depths can be modified using depths.dive<-. For example d <- dive(c(30,20)) creates a dive to 30 metres for 20 minutes, starting and finishing at the surface; to change the depth to 35 metres, type depths.dive(d)[2:3] <- 35. Similarly the elapsed times can be modified using times.dive<-. It may be more convenient to use the functions durations.dive and durations.dive<- which give the duration of each stage (the time between two successive waypoints). For example durations.dive(d)[2] <- 25 would mean that the diver now spends 25 minutes at the bottom instead of 20 minutes.
的命令depths.dive和times.dive在潜水过程中提取深度和运行时间在每个航点。深度可修改使用depths.dive<-。例如“d <- dive(c(30,20))创造一个下潜至30米,20分钟,起点和终点在表面上要改变深度35米,型depths.dive(d)[2:3] <- 35。同样的,经过时间可以修改使用times.dive<-。这可能是更方便使用的功能durations.dive和durations.dive<-,每个阶段的持续时间(连续两个航点之间的时间)。例如durations.dive(d)[2] <- 25将意味着现在的潜水员底部花费25分钟,而不是20分钟。
To extract only part of a dive profile, use chop.dive.
只提取部分的潜水资料,使用chop.dive。
To paste together two dive profiles or fragments of dive profiles, simply give them as arguments to dive.
要粘贴两个的潜水资料或潜水的片段,只需给它们的参数dive。
改变呼吸气体----------Changing the breathing gases----------
A dive object has a tank list which is a list of the tanks of breathing gas that were used (or were available to be used) during the dive. The function tanklist returns this list, and the function tanklist<- changes the list.
潜水对象,这是一个列表,使用(或可使用)在潜水过程中的呼吸气体的坦克坦克列表。的功能tanklist返回此列表中,函数tanklist<-更改列表。
For example, d <- dive(c(30,20), c(5,5)) is a dive conducted using air. To modify it to a dive that used nitrox EANx 32, simply type tanklist(d) <- list(nitrox(0.32)). Again d <- dive(air, c(30,40), 6, nitrox(0.5), c(6,3), c(3,3)) is a dive conducted using air (tank 1) for the deep section and EANx 50 (tank 2) for the decompression stops at 6 metres and 3 metres. To change the contents of tank 1 to EANx 32, type tanklist(d) <- list(nitrox(0.32), nitrox(0.5)) or just tanklist(d)[[1]] <- nitrox(0.32). To associate a name which each tank, give names to the entries in the tank list, for example tanklist(d) <- list(deep=nitrox(0.32), deco=nitrox(0.5)) or just assign names(tanklist(d)) <- c("deep", "deco").
例如,d <- dive(c(30,20), c(5,5))是利用空气进行潜水。要修改它,潜水,使用氮氧EANx 32,只需键入tanklist(d) <- list(nitrox(0.32))。 d <- dive(air, c(30,40), 6, nitrox(0.5), c(6,3), c(3,3))是使用空气(坦克1)深部和EANx的50(罐)的减压停留在6米和3米的潜水进行。要改变内容的坦克1 EANx 32,请键入“tanklist(d) <- list(nitrox(0.32), nitrox(0.5))或只是tanklist(d)[[1]] <- nitrox(0.32)。要关联的名称,每个水箱,给水箱列表中的条目名称,,例如tanklist(d) <- list(deep=nitrox(0.32), deco=nitrox(0.5))“或只是分配names(tanklist(d)) <- c("deep", "deco")。
The selection of tanks, i.e. which tank is actually used at each stage of the dive, is specified by the function whichtank. The command whichtank(d) returns a vector of integers or character strings, identifying which tank in the tank list is in use at each waypoint during the dive. That is, whichtank(d)[i] is the tank in use at the ith waypoint during the dive. The vector whichtank(d) has the same length as the vectors depths.dive(d) and times.dive(d).
坦克,即罐实际使用的潜水在每个阶段,选择所指定的功能whichtank。命令whichtank(d)返回一个向量的整数或字符串,确定坦克在坦克列表是在潜水过程中使用的每个航点。也就是说,whichtank(d)[i]是坦克的使用在i在潜水过程中的个航点。向量whichtank(d)具有相同的长度作为矢量depths.dive(d)和times.dive(d)。
To change the selection of tanks at each stage during the dive, use the function whichtank<-. For example, d <- dive(air, c(30,40), 6, nitrox(0.5), c(6,3), c(3,3)) is a dive conducted using air (tank 1) for the deep section and EANx 50 (tank 2) for the decompression stops at 6 metres and 3 metres. To change this so that the deco gas is only used at the 3-metre stop, type whichtank(d) <- ifelse(depths.dive(d) < 3, 1, 2). Alternatively whichtank(d)[depths.dive(d) > 3] <- 1 would select tank 1 for all parts of the dive deeper than 3 metres. These manipulations are usually easier to understand if the tanks have names. For example typing names(tanklist(d)) <- c("deep", "deco") we could then type whichtank(d) <- ifelse(depths.dive(d) < 3, "deep", "deco") or whichtank(d)[depths.dive(d) > 3] <- "deep".
在潜水过程中,要改变选择的坦克在每个阶段使用的功能whichtank<-。例如,d <- dive(air, c(30,40), 6, nitrox(0.5), c(6,3), c(3,3))是使用空气(罐)的的深部和EANx 50(罐2)减压停留在6米和3米的潜水进行。要改变这样的装饰气体仅在3米停止使用,类型whichtank(d) <- ifelse(depths.dive(d) < 3, 1, 2)。另外whichtank(d)[depths.dive(d) > 3] <- 1会选择所有的潜水深度超过3米的箱1。这些操作通常是比较容易理解,如果坦克的名称。例如打字names(tanklist(d)) <- c("deep", "deco")“然后,我们可以键入whichtank(d) <- ifelse(depths.dive(d) < 3, "deep", "deco")或whichtank(d)[depths.dive(d) > 3] <- "deep"。
牌照----------Licence----------
This library and its documentation are usable under the terms of the "GNU General Public License", a copy of which is distributed with the package.
使用这个库和它的文档的副本,其中的“GNU通用公共许可证”的条件下,随产品打包发布。
(作者)----------Author(s)----------
Adrian Baddeley
<a href="mailto:Adrian.Baddeley@csiro.au">Adrian.Baddeley@csiro.au</a>
<a href="http://www.maths.uwa.edu.au/~adrian/">http://www.maths.uwa.edu.au/~adrian/</a>
with contributions from Vittorio Broglio
and Pedro Antonio Neves.
参考文献----------References----------
Vignette accompanying this package.
Classical theory of decompression and the design of scuba diving tables. To appear in The Mathematical Scientist.
Undersea and Hyperbaric Medicine Society, Kensington, Maryland (USA). ISBN 0-930406-13-3.
The prevention of compressed air illness. Journal of Hygiene (London) 8, 342–443.
Bennett and Elliott's Physiology and Medicine of Diving. 5th Edition. Saunders. ISBN 0-7020-2571-2
Dekompression - Dekompressionskrankheit. Springer-Verlag.
Tauchmedizin. 5e Auflage. Springer-Verlag.
Decompression Theory. In Brubakk and Neuman (2003), Chapter 10.1, pages 419-454.
Basic diving physics and applications. Best Publishing Co.
for nitrogen-oxygen and helium-oxygen dives. Research Report 6-65. US Navy Experimental Diving Unit. Washington DC.
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|