[R] Fwd: How to edit a dataframe/tibble in R console

Yousri Fanous you@r|@|@nou@ @end|ng |rom gm@||@com
Mon Apr 27 00:40:13 CEST 2020


Jim solution posted

Yousri

---------- Forwarded message ---------
From: Jim Lemon <drjimlemon using gmail.com>
Date: Sun, Apr 26, 2020 at 6:30 AM
Subject: Re: [R] How to edit a dataframe/tibble in R console
To: Yousri Fanous <yousri.fanous using gmail.com>


Hi Yousri,
This may help:

rootstock.df<-as.data.frame(lapply(rootstock,as.vector))
edit(rootstock.df)

Jim

On Sun, Apr 26, 2020 at 5:21 PM Yousri Fanous <yousri.fanous using gmail.com>
wrote:
>
> I recently installed R 3.6.3 on my windows laptop.
>
> R version 3.6.3 (2020-02-29)
>
> I am trying to import a stata .dta file to R
>
> >url<-“http://www.stata-press.com/data/r10/rootstock.dta”
>
> >library(tidyverse)
>
> >library(haven)
>
> >rootstock<-read_dta(url)
>
>
> All works as expected.
>
>
> >class(rootstock)
> [1] "tbl_df"     "tbl"        "data.frame"
>
>
> Now I cannot use the edit command with a tibble or a data frame
>
>
> > edit(rootstock)
> Error in edit.data.frame(rootstock) :
>   can only handle vector and factor elements
>
>
> I noticed that their is an add-on package editData for Rstudio, but I
> cannot use it from the console:
>
> >library(editData)
> >editData(rootstock)
> Error: RStudio not running
>
>
> How can I edit a tibble/dataframe from the console?
>
>
> Yousri Fanous
>
> Software Developer
>
> IBM Canada
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

	[[alternative HTML version deleted]]



More information about the R-help mailing list