Questions tagged [tidy]

Tidy is a C library for cleaning up "bad" HTML. Don't use this tag for questions about keeping your code tidy.

Tidy is a library written in C for converting HTML that is syntactically incorrect to correct HTML or to XHTML. Especially useful when you are scraping web pages with curl and XML parsing functions because XML parsing functions don't accept bad HTML. Extensions for Tidy are available in PHP and Perl. The Tidy extension in PHP supports functions to covert bad HTML to XHTML with various options like dropping deprecated tags like font tag and hiding comments and dropping proprietary tags and dropping empty paragraphs and a lot more.

571 questions
3
votes
2 answers

Pivot_wider function (tidyr r package) from multiple variables

I would like to put the dataframe in the wide format considering two variables as criteria (maybe even unnecessary). But I comment on this because the original df is 480 rows and several sub-levels. This is returning an…
Cristiano
  • 233
  • 1
  • 9
3
votes
1 answer

Tidy multiple anovas

I have tidy data, and followed the example here. Worked on my office computer, doesn't on my home computer. Now I get: Error in var(if (is.vector(x) || is.factor(x)) x else as.double(x), na.rm = na.rm) : is.atomic(x) is not TRUE In addition:…
Elk
  • 491
  • 2
  • 9
3
votes
2 answers

Can't get HTML text using libtidy

everybody - long time listener, first time caller. I've been playing around with libtidy in C on macOS 10.13. I started with the sample code here and modified it to read a local html file instead of using curl. Everything seems to work okay except…
3R1N
  • 89
  • 3
3
votes
1 answer

How to configure VIM Ale to use the Tidy linter for HTML?

I'm trying to configure the vim Ale plugin to use Tidy to lint HTML code. I added to my .vimrc file: let g:ale_linters = { \ 'css': ['csslint'], \ 'html': ['tidy'], \ 'javascript': ['eslint'], \ 'php': [''], \ 'python': ['flake8'], …
burke
  • 89
  • 2
  • 2
  • 10
3
votes
3 answers

How to use tidy evaluation with column name as strings?

I've read most of the documentation about tidy evaluation and programming with dplyr but cannot get my head around this (simple) problem. I want to programm with dplyr and give column names as strings as input to the function. df <- tibble( g1 =…
3
votes
1 answer

tidy - How to remove duplicate ID's from HTML

I have a HTML that need to be parsed by DOMDocument::loadHtml($html), but it gives me an error: DOMDocument::loadHTML(): ID 'my id' already defined in Entity I don't have control about the $html, but I can use tidy lib (or something else, ideas?) on…
Lucas
  • 81
  • 1
  • 3
3
votes
3 answers

How to use the Spread function using only one value of the target column?

We have the following data frame a with something like this: > a google_prod Value 1 categoria ML 2 google 120 3 youtube 24 4 categoria AO 5 google 2 6 youtube…
3
votes
1 answer

How do you pivot_wider where values are characters?

I want to use pivot_wider or spread where the values are character strings. Here's an example: a <- c("a", "a", "b", "c", "c", "c") x <- c("x", "y", "y", "x", "y", "z") m <- cbind(a,x) > m a x [1,] "a" "x" [2,] "a" "y" [3,] "b" "y" [4,] "c"…
3
votes
1 answer

Python exception thrown by libtidy is amusingly impossible to catch

I am trying to use the tidy_document() function from tidylib to format an html document as xhtml before I can post it somewhere and a couple of steps up the stack, an exception is being thrown. The code is wrapped in a try...except block, with about…
legend855
  • 45
  • 7
3
votes
1 answer

How to install/enable Tidy extension in PHP 7.2 on Ubuntu 14.04?

Problem: Using tidy_parse_string() returns: call to undefined function Tried: Searching: apt-cache search tidy But i only see this php extension in the returned list : php5-tidy - tidy module for php5 How do i install the module for PHP 7.2? I…
lowkey
  • 334
  • 1
  • 7
  • 17
3
votes
2 answers

Php can't find tidy

I am using a php7 in docker container to run a service based on phpdocx library. It needs tidy and some other extensions installed and active to work. I have installed php-tidy however I am getting following warning. PHP Warning: PHP Startup:…
Singh Lalit
  • 471
  • 5
  • 9
3
votes
1 answer

`dplyr::full_join()` doesn't work with list columns

I am trying to compare formals for two versions of a given function in R package ggstatsplot. I have been able to extract formals in tibbles but I can't seem to get these two tables to join. dplyr::full_join() produces an error but it is not really…
Indrajeet Patil
  • 4,673
  • 2
  • 20
  • 51
3
votes
5 answers

Prefix/suffix column content with column names

I want to mutate column content of a data frame so that the cell content is prefixed by the column name: > x <- data.frame(VarX = rep(c("A","B"),2), VarY = rep(c("C","D"),2)) > x VarX VarY 1 A C 2 B D 3 A C 4 B D > x$VarX…
witek
  • 984
  • 1
  • 8
  • 25
3
votes
1 answer

Efficiently create data.frames for a changing number of input csv files with identical 'tidy' format and size

I can't figure out how to: efficiently create, with rbind or another way, a data.frame compiling csv-derived data.frames, whose number varies for different projects. Or similarly: efficiently create a data.frame of the difference between a…
dbo
  • 1,174
  • 1
  • 11
  • 19
3
votes
1 answer

Format CSS with VIM like in Textmate

In TextMate there is this awesome option to "Format CSS" and "Format CSS Compressed". This option doesn't seem to exist in vim. Perhaps it's in a plugin I'm not aware of? Or maybe I need to integrate CSS Tidy somehow?
maletor
  • 7,072
  • 7
  • 42
  • 63