微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

R EnvStats将elnormAlt的结果打包到数据帧

如何解决R EnvStats将elnormAlt的结果打包到数据帧

编辑:我想将一些统计测试的结果列表到数据框中。我需要使用长格式数据,并且需要使用group_by。我已经包含了一些数据和使用elnormAlt函数计算极限的代码。下面的代码为我提供了列值中所有观察值的LCL和UCL,我想将按名称分组的结果制成表格吗?

我们将很高兴收到我提出的任何想法或方向。

public async Task<byte[]> DecodeImageAsync(string fileUri,int regWidth,int regHeight,int compressionQuality)
{
    byte[] returnVal;

    try
    {
        StorageFile file = await StorageFile.GetFileFromPathAsync(fileUri);

        using (IRandomAccessstream stream = await file.OpenAsync(FileAccessMode.Read))
        {
            BitmapDecoder decoder = await BitmapDecoder.CreateAsync(stream);
            SoftwareBitmap softwareBitmap = await decoder.GetSoftwareBitmapAsync();

            var qualityNum = (float) compressionQuality / 100;
            var propertySet = new BitmapPropertySet();
            var qualityValue = new BitmapTypedValue(
                qualityNum,Windows.Foundation.PropertyType.Single
            );
            propertySet.Add("ImageQuality",qualityValue);

            var resizedStream = new InMemoryRandomAccessstream();

            BitmapEncoder encoder = await BitmapEncoder.CreateAsync(BitmapEncoder.JpegEncoderId,resizedStream,propertySet);
            encoder.SetSoftwareBitmap(softwareBitmap);
            
            double widthRatio = (double) regWidth / decoder.PixelWidth;
            double heightRatio = (double) regHeight / decoder.PixelHeight;

            double scaleRatio = Math.Min(widthRatio,heightRatio);

            if (regWidth == 0)
                scaleRatio = heightRatio;

            if (regHeight == 0)
                scaleRatio = widthRatio;

            uint aspectHeight = (uint) Math.Floor(decoder.PixelHeight * scaleRatio);
            uint aspectWidth = (uint) Math.Floor(decoder.PixelWidth * scaleRatio);

            encoder.BitmapTransform.InterpolationMode = BitmapInterpolationMode.Linear;
            encoder.BitmapTransform.ScaledHeight = aspectHeight;
            encoder.BitmapTransform.ScaledWidth = aspectWidth;
            
            await encoder.FlushAsync();
            resizedStream.Seek(0);
            returnVal = new byte[resizedStream.Size];
            var dr = new DataReader(resizedStream.GetInputStreamAt(0));
            await dr.LoadAsync((uint) resizedStream.Size);
            dr.ReadBytes(returnVal);
        }
    }catch (Exception ex)
    {
        return null;
    }
    return returnVal;
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。