我在“足迹”形状非常不规则的区域中有一系列要点:
我想确定轮廓线顶点内的所有坐标。最终目标是确定哪些数据点不在此覆盖范围内。
有没有人有一个有效的方法去做呢?
我最好的解决方法是根据绿色区域的顶点绘制一个多边形,然后使用该多边形的坐标来确定“离群点”(尽管我不确定该怎么做,一次只一步) !)。
但是,当我尝试创建凸包时,由于绿色空间的形状不规则,显然会产生问题。[有人知道创建CONVAVE船体的方法吗?]
或者,是否可以使用“单击图形”类型的方法手动绘制多边形?
...同样,如果您对我的问题有比使用多边形更好的解决方案,请务必提出解决方案!
有没有办法将日历输入布局(ala dateInput())用于非日期数据?
具体来说,我希望能够打开日历视图,但不是日期,而是有一个可供选择的输入值网格.
如果可能,生成的图形将打开如下:
(注意:上图中的#是随意的和随机的)
我已经查看了代码dateInput,但我不会立即明白如何开始转换代码以使用输入值而不是日期...
我正在使用waterfall_chartPython中的包创建瀑布图。该软件包主要用于matplotlib后端,因此我试图使用该tls.mpl_to_plotly(mpl_fig)功能将matplotlib图形隐藏到plotly。但是在转换时会弹出错误。有没有一种方法可以转换waterfall_chart成plotly该图表,或者有一种简单的方法可以直接在其中创建图表plotly?我看到类似的一些前面的讨论图表中plotly,但它涉及相当手册图表数量的编码。
您可以使用以下代码重新创建图表。
import waterfall_chart
import matplotlib.pyplot as plt
import plotly.tools as tls
a = ['sales','returns','credit fees','rebates','late charges','shipping']
b = [10,-30,-7.5,-25,95,-7]
mpl_fig = plt.figure()
waterfall_chart.plot(a, b)
plt.show()
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试转换为plotlyusing时mpl_to_plotly(),出现错误:
plotly_fig = tls.mpl_to_plotly(mpl_fig)
ValueError: min() arg is an empty sequence
Run Code Online (Sandbox Code Playgroud)
该waterfall_chart软件包的详细信息可以在这里找到:https : //github.com/chrispaulca/waterfall/blob/master/waterfall_chart.py
如何定义Component虚拟函数中的类型?
@Component({
templateUrl: 'a'
})
export class MyApp {
}
function dummy(component: any) {
....
}
dummay(MyApp);
Run Code Online (Sandbox Code Playgroud) 如何glmnet在R包"glmnet"处理NA值?
或者它不能容忍NA值?
有没有办法让R中的density()函数使用计数与概率?
例如,在使用直方图函数检查密度分布时,我有两个选择hist:
hist(x,freq=F) #"graphic is a representation of frequencies, the counts component of the result"
hist(x,freq=T) #"probability densities, component density, are plotted (so that the histogram has a total area of one)"
Run Code Online (Sandbox Code Playgroud)
我想知道是否可以使用该density功能执行类似的操作?
在我的具体示例中,我有许多直径不同的树木。(我会注意到,我将数据保持为连续的大小比例,而不是将其分为离散的大小类)。当我将density函数与该数据一起使用时(即plot(density(dat$D,na.rm=T,from=0))),它为我提供了每种尺寸的概率(当然是平滑的)的密度估计。我对将这些数据报告为茎/面积与概率的关系更感兴趣,因此我更喜欢密度估计值来使用计数。
想法?
更新:
这是一些真实的示例数据:
dat <- c(6.6, 7.1, 8.4, 27.4, 11.9, 18.8, 8.9, 25.4, 8.9, 8.6, 11.4, 19.3, 7.6, 42.2, 20.8, 25.1, 38.1, 42.2, 5.2, 34.3, 42.7, 34, 37.3, 45.5, 39.4, 25.1, 30.7, 23.1, 43.4, 19.6, 30.5, 23.9, 10.7, …Run Code Online (Sandbox Code Playgroud) r histogram frequency-distribution kernel-density density-plot
假设我有数据:
x <- c(1900,1930,1944,1950,1970,1980,1983,1984)
y <- c(100,300,500,1500,2500,3500,4330,6703)
Run Code Online (Sandbox Code Playgroud)
然后,我绘制这些数据并在已知的 x 和 y 坐标之间添加一个折线图:
plot(x,y)
lines(x,y)
Run Code Online (Sandbox Code Playgroud)
有没有办法预测沿图形线的未知点的坐标?
我有一个gls模型,我将一个公式(从另一个对象)分配给模型:
equation <- as.formula(aic.obj[row,'model'])
> equation
temp.avg ~ I(year - 1950)
mod1 <- gls(equation, data = dat)
> mod1
Generalized least squares fit by maximum likelihood
Model: equation
Data: dat
Log-likelihood: -2109.276
Run Code Online (Sandbox Code Playgroud)
但是我不希望"模型"成为"方程式"而是"quation"本身!我该怎么做呢??
如果我想使用共享案例(又名关系)的最小排名对一组数字进行排名:
dat <- c(13,13,14,15,15,15,15,15,15,16,17,22,45,46,112)
rank(dat, ties = 'min')
Run Code Online (Sandbox Code Playgroud)
我得到结果:
1 1 3 4 4 4 4 4 4 10 11 12 13 14 15
Run Code Online (Sandbox Code Playgroud)
但是,我希望等级是由 1,2,3,... n组成的连续系列,其中n是唯一等级的数量。
有没有办法rank通过将关系分配给上述最低等级来使(或类似功能)对一系列数字进行排名, 而不是按先前关系的数量跳过后续等级值,而是继续从前一个等级开始排名?
例如,我希望上述排名结果为:
1 1 2 3 3 3 3 3 3 4 5 6 7 8 9
Run Code Online (Sandbox Code Playgroud) 例如:我有数字 123.456 并想返回 456。
该函数trunc()基本上隔离(截断)小数点前的数字。
有没有一个函数可以只隔离小数点后的数字?
两个后续问题:
有没有办法在不写出正则表达式的情况下做到这一点?
如果我想保留标志怎么办?例如,如果我想(反向)将 -123.456 截断为 -456。
r ×8
angular ×1
concave-hull ×1
coordinates ×1
datepicker ×1
decimal ×1
density-plot ×1
digit ×1
footprint ×1
formatting ×1
formula ×1
glmnet ×1
histogram ×1
input ×1
isolation ×1
lines ×1
matplotlib ×1
modeling ×1
na ×1
nlme ×1
plotly ×1
points ×1
polygon ×1
python ×1
rank ×1
ranking ×1
regression ×1
scatter-plot ×1
shiny ×1
truncated ×1
typescript ×1