首页 \ 问答 \ 粘贴基于行中元素的数量(paste based in the number of elements in the row)

粘贴基于行中元素的数量(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
更新时间:2023-04-29 12:04

最满意答案

您可以尝试使用可用于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 am IDEAEngine (and similar for other classes).

相关问答

更多
  • okay idea 是这个创意还可以 good idea 是这个创意真不错 good idea 强烈一些, excellent idea 更加强烈
  • 对于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)
  • 如果您的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 ...
  • 您可以尝试使用可用于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作为通知系统。 当你从这个角度看待它时,它并不是一个糟糕的主意。 在最坏的情况下,支持人员会收到新机票的通知并登录,以惊喜地发现机票不再存在。 如果您查看类似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 ...

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)