按切割范围分组数值

时间:2017-03-09 04:36:59

标签: r cut categorical-data aspect

我已采样范围为0-360的栅格ASPECT数据,现在我想将这些数据分组到方向(北,南,东,东等)。

我找到了剪切功能并希望尝试使用它,但似乎有些东西不起作用。对于我的休息时间,我有10个范围,但我不断得到我的休息时间和标签长度不同的错误。它说我休息的时间长度是20,我不知道为什么。有什么建议吗?

using System;

namespace PSExec_42280413
{
    class Program
    {
        static void Main(string[] args)
        {
            DoIt();

        }

        private static void DoIt()
        {
            System.Diagnostics.Process proc = new System.Diagnostics.Process();
            proc.ErrorDataReceived += Proc_ErrorDataReceived;
            proc.OutputDataReceived += Proc_OutputDataReceived;
            proc.Exited += Proc_Exited;

            proc.StartInfo.FileName = @"c:\windows\syswow64\psexec_64.exe";
            proc.StartInfo.Arguments = @"-i -u usr -p pwd \\server -c M:\StackOverflowQuestionsAndAnswers\PSExec_42280413\PSExec_42280413\TheBatFile.bat";
            proc.StartInfo.RedirectStandardError = true;
            proc.StartInfo.RedirectStandardInput = true;
            proc.StartInfo.RedirectStandardOutput = true;
            proc.StartInfo.UseShellExecute = false;
            proc.EnableRaisingEvents = true;
            proc.Start();
            proc.BeginErrorReadLine();
            proc.BeginOutputReadLine();

            //if the process runs too quickly, the event don't have time to raise and the application exits.
            //this here takes care of slooowwwwwiiinnnnnggggg things down
            //there are more elegant ways to wait and it does not have to be this long
            Int64 bigone = 200000000;
            while (bigone > 0)
            {
                bigone--;
            }
        }

        private static void Proc_Exited(object sender, EventArgs e)
        {
            //string out = ((System.Diagnostics.Process)sender).StandardError.ReadToEnd();//not while BeginErrorReadLine() is set.
            Console.WriteLine("done");
            System.Diagnostics.Debugger.Break();
        }

        private static void Proc_OutputDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
        {
            Console.Write("1");
            //System.Diagnostics.Process process = (System.Diagnostics.Process)sender;
            //System.Diagnostics.Debugger.Break();
        }

        private static void Proc_ErrorDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
        {
            Console.Write("0");
            //System.Diagnostics.Process process = (System.Diagnostics.Process)sender;
            //System.Diagnostics.Debugger.Break();
        }
    }
}

1 个答案:

答案 0 :(得分:0)

休息应该是连续的。在你的情况下cut考虑你的向量之间的间隙(例如-1; 0)作为需要标签的中断。通常,中断看起来像这样:c(-2,-1, 0,22.5, 67.5,112.5,157.5,202.5,247.5,292.5,337.5,360)