首页 \ 问答 \ R Matrix,获取最小列的索引(R Matrix, get the index of minimum column)

R Matrix,获取最小列的索引(R Matrix, get the index of minimum column)

我是R的新手,我正在学习。 我已经计算了这个区别,就像这样。 (与欧米茄的区别)

final_wights <- apply(wjs,2, function(x) (omega - x))^2 

现在我想获得最小列的列号。 我可以使用最小列值

col <- apply(final_wights, 2, min)

但我想获得索引,我如何获得矩阵中的索引列号


I am very new to R, I am learning. I have calculated the difference, column wise like this. (difference with omega)

final_wights <- apply(wjs,2, function(x) (omega - x))^2 

Now i want to get the column number of the minimum column. I can get minimum column value using

col <- apply(final_wights, 2, min),

But i want to get the index of that how do i just get the index column number in the matrix


原文:https://stackoverflow.com/questions/29666700
更新时间:2023-05-10 12:05

最满意答案

发现没有办法获得HTTPStatus代码以获得成功的响应。 只需听取异常即可确保成功上传。


Find out that there is no way to get the HTTPStatus Code for successful response. Just Listening to exceptions is enough to be sure of the succeeded upload .

相关问答

更多
  • 要在上传之前将该文件公开,您可以使用#withCannedAcl方法: myAmazonS3Client.putObject(new PutObjectRequest('some-grails-bucket', 'somePath/someKey.jpg', new File('/Users/ben/Desktop/photo.jpg')).withCannedAcl(CannedAccessControlList.PublicRead)) To make the file public befo ...
  • Amazon S3和CloudFront都不提供带宽限制。 如果带宽限制对您很重要,则必须编写自己的前端访问Amazon S3,以监控和限制带宽。 Neither Amazon S3 nor CloudFront provide bandwidth limits. If bandwidth limits are important to you, you'll have to write your own front end access to Amazon S3 that monitors and lim ...
  • 您的网址存在错误。 比较您收到的回复中的密钥: crawl-data/CC- MAIN-2018-05/segments/1516084886237.6/warc/CC- MAIN-20180116070444-20180116090444-00000.warc.gz\n 到预期的网址中的一个: https://commoncrawl.s3.amazonaws.com/crawl-data/CC-MAIN-2018-05/segments/1516084886237.6/warc/C ...
  • 如果您有防火墙,请检查您的设置。 您的防火墙很可能会过滤掉亚马逊的某些响应。 If you have a firewall, check your settings. It is quite possible that your firewall is filtering out certain responses from amazon.
  • 感谢迈克尔的评论,我能够进一步追踪这个问题。 事实证明,问题实际上来自对deleteObjects()的调用。 这些命令正在cli上的shell脚本中执行,结果是在最后一次调用putObject()之前还有另一个调用。 它试图将空数组发送到s3服务......这显然会返回给定的MalformedXML状态代码。 Thanks to the comment from Michael I was able to track the issue down further. It turns out that th ...
  • 发现没有办法获得HTTPStatus代码以获得成功的响应。 只需听取异常即可确保成功上传。 Find out that there is no way to get the HTTPStatus Code for successful response. Just Listening to exceptions is enough to be sure of the succeeded upload .
  • 我理解你有关获取内容类型的对象的问题。 我认为迈克尔的答案有一些信息可以解决这个问题。 我只是想在S3存储桶中存储对象时添加一些额外的信息。 将对象添加到存储桶时,可以在元数据字段中设置内容类型。 如果要存储对象并在以后检索它,请在元数据中添加内容类型(Content-Type)。 这样您就可以在阅读时获取对象的内容类型。 如果稍后添加和检索对象,这是更好的方法。 doc application/msword docx application/vnd.openxmlformats-office ...
  • 如你所说,你错过了一件小事。 使用ListVersionsRequest的前缀 例如 ListVersionsRequest Request = new ListVersionsRequest(); Request.BucketName = DocumentStorageFolder(DocumentId); Request.Prefix = KeyName 卡迈勒 As you mentioned, you are missing a small thing. Use prefix of the Lis ...
  • S3确实提供了对图像进行签名的功能,以便URL仅在有限的时间段内有效。 这里有更多细节 如此处所述,有多种处理访问的方法 S3 does provide the ability to sign an image so that the URL is only valid for a limited period of time. There are more details of that here There are a number of ways of handling access as descr ...
  • Java示例是关于如何使用Java下载并从Memory向MediaInfo发送数据的示例。 现在MediaInfo对S3有本机支持。 所以只需提供此URL即可。 唯一的问题是你必须拥有libcurl和使用libcurl支持编译的MediaInfo。 这在所有平台上都不可用(例如,在Windows上,您必须将来自libcurl网站的libcurl.dll放在与mediainfo相同的文件夹中)。 计划更好地提供此类支持(在所有平台上直接提供libcurl并进行全面测试),但没有ETA。 The Java ex ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)