粘贴基于行中元素的数量(paste based in the number of elements in the row)
这是我的数据框
s <- data.frame( x = c("a","b","c"), y = c("d","e", NA), z = c(NA,"j",NA) )
我想连接(粘贴)基于条件的值,我只想用逗号粘贴非空值,所以我想要的结果是:
a,b,c d,e j
也许这很简单,但我不知道该怎么做。
This is my dataframe
s <- data.frame( x = c("a","b","c"), y = c("d","e", NA), z = c(NA,"j",NA) )
And I want to concatenate(paste) the values based a condition, I want to paste with comma only the non null values, so the vector I want as result is:
a,b,c d,e j
Maybe it is very simple, but I'm not sure how to do it.
原文:https://stackoverflow.com/questions/35213242
最满意答案
您可以尝试使用可用于Java和C#的BouncyCastle 。 但是,根据此注意事项 ,您需要获得IDEA支持的正确jar(假设为Java):
应许多用户的请求,从版本1.40开始,IDEA加密算法的实现从常规jar文件中删除。 名称为-ext-的Jars仍包含IDEA实现。
编辑 (添加指向示例):我还没有尝试过,但我认为DESExample可以适应做你想做的事情,可能通过用
DESedeEngine
替代IDEAEngine
(以及类似的其他类)。You could try to use BouncyCastle, which is available for Java and C#. However, you'll need to get the right jars (assuming Java) for IDEA support, according to this note:
From release 1.40 the implementation of the IDEA encryption algorithm was removed from the regular jar files at the request of a number of users. Jars with names of the form -ext- still include the IDEA implementation.
EDIT (added pointer to example): I haven't tried, but I think that the DESExample could be adapted to do what you want, probably by replacing the
DESedeEngine
with amIDEAEngine
(and similar for other classes).
相关问答
更多-
okay idea 和good idea区别[2022-03-13]
okay idea 是这个创意还可以 good idea 是这个创意真不错 good idea 强烈一些, excellent idea 更加强烈 -
IDEA和Eclipse:如何在扩展类时自动生成方法(IDEA and Eclipse : How to automatic generate method when extends a class)[2022-06-21]
对于Eclipse,进入源菜单( Alt+Shift+s ) - >覆盖/实现方法...,这应该给你一个所有可以是@overriden的方法的列表。 For Eclipse, go into the Source menu (Alt+Shift+s) -> Override/Implement Methods... and this should give you a list of all the methods that can be @overriden. -
您的应用程序的插件性质与您实现此目标的机制几乎没有关系。 从本质上讲,您需要一组视图模型。 该集合中的每个项目代表一个插件(但它可以同样代表客户或鸡腿)。 然后,将ItemsControl绑定到此集合,并定义应如何呈现项目的模板。 这里有一些伪代码可以帮助您: public class PluginViewModel : ViewModel { public string Name { get; } public PluginState State { get; private set; } ...
-
我想这就是你想要的: 右键单击 - > Go To - > Implementations (Ctrl + Alt + B) I think this is what you want: Right Click -> Go To -> Implementations (Ctrl + Alt + B)
-
如何提高IDEA性能?(How to improve IDEA performance?)[2022-03-10]
如果您的IntelliJ IDEA存在性能问题,请参阅CPU快照和线程转储说明。 In case you have performance problems with IntelliJ IDEA, refer to the CPU snapshot and thread dump instructions. -
如果您的核心用户交互将依赖于Ajax(例如Google Docs),那么您应该尽早实施这些比特。 否则,如果您的核心交互依赖于可靠地存储和检索数据,请最后添加Ajax。 通过这种方式,您可以强制自己和团队测试应用程序的行为,就好像JavaScript在用户的浏览器中不可用一样。 在这种情况下,Ajax将会是一个额外的用户界面层。 If your core user interactions will rely on Ajax (e.g., Google Docs), then you should impl ...
-
如何实施IDEA?(How to implement IDEA?)[2022-01-15]
您可以尝试使用可用于Java和C#的BouncyCastle 。 但是,根据此注意事项 ,您需要获得IDEA支持的正确jar(假设为Java): 应许多用户的请求,从版本1.40开始,IDEA加密算法的实现从常规jar文件中删除。 名称为-ext-的Jars仍包含IDEA实现。 编辑 (添加指向示例):我还没有尝试过,但我认为DESExample可以适应做你想做的事情,可能通过用DESedeEngine替代IDEAEngine (以及类似的其他类)。 You could try to use BouncyC ... -
关键字是可以满足的 。 所有WYSIWYG编辑器都基于此属性设置为true的元素。 创建一个页面:foo! foo!foo! foo!并在任何浏览器上打开它。 这个div是可编辑的 - 你可以输入它,按回车,按ctrl + b等。 看起来你已经接近最终的解决方案,但是......不是。 您很快就会注意到,每个浏览器都以不同的方式创建标记,在一个浏览器上创建并加载到另一个 ...
-
为帮助台分配实施RSS提要是一个坏主意吗?(Is it a bad idea to implement an RSS feed for help desk assignments?)[2022-06-09]
听起来您正在尝试使用RSS作为通知系统。 当你从这个角度看待它时,它并不是一个糟糕的主意。 在最坏的情况下,支持人员会收到新机票的通知并登录,以惊喜地发现机票不再存在。 如果您查看类似JIRA的内容,它会使用电子邮件通知来通知人们已分配了故障单。 如果重新分配了故障单,则分配给该人员的人员以及将分配给该人员的人员都会收到更改通知。 人们可以选择“收听”故障单,并会收到有关故障单上发生的任何工作,状态变化等的通知。 你可能想考虑做这样的事情。 维护大量的RSS源可能会非常繁琐。 如果支持人员离开会怎样? 通过 ... -
我将使用has_many :votes, :through => :links和sum方法的功能。 有关其他信息,请查看 关于协会的Ruby on Rails指南 Ruby on Rails计算指南 所以这是解决方案: 用户表 class CreateUsers < ActiveRecord::Migration def self.up create_table :users do |t| t.string :name t.timestamps end end ...