Code Monkey home page Code Monkey logo

Comments (14)

mamuerie avatar mamuerie commented on May 25, 2024 1

Hi @ClaudioZandonella,
thanks for your fast response! I tried it today on my private computer (both are windows machines) with the latest RStudie and R Version and there it worked perfectly fine. So it seems that it is somehow related to that. Sorry that I did not try this before I asked here!

from trackdown.

weiyangtham avatar weiyangtham commented on May 25, 2024 1

Hi, really excited about this package but just wanted to add that I'm having this problem too. This is the header I have in my .rmd document. I'm using Mac OS (Big Sur). Adding "[[document-header]] at the top of the Google Doc doesn't seem to help either.

title: "Untitled"
author: "Wei Yang Tham"
date: "8/24/2021"
output: html_document

from trackdown.

ClaudioZandonella avatar ClaudioZandonella commented on May 25, 2024 1

Hi @weiyangtham!

Thank you very much for your help!

The problem was caused by character vectors considered as factors in dataframe. Shame on me that I did not consider the stringsAsFactors issue for R versions before 4.0.0πŸ˜…

Now I fixed the problem by specifying stringsAsFactors = FALSE

Now changes are available on GitHub with the new version of trackdown 1.0.1

@weiyangtham and @dfranquesa could you please try the new version of the package and confirm if the problem is now solved?

You can install the GitHub version of the package with

# install.packages("remotes")
remotes::install_github("claudiozandonella/trackdown",
                         build_vignettes = TRUE)

Thank you so much for your help debugging this issue❀️

from trackdown.

weiyangtham avatar weiyangtham commented on May 25, 2024 1

Works for me now! Thanks for the fix!

from trackdown.

dfranquesa avatar dfranquesa commented on May 25, 2024 1

You are right! uauuu! it works now, thanks!

from trackdown.

ClaudioZandonella avatar ClaudioZandonella commented on May 25, 2024

Hi @mamuerie,

We are really happy that you find trackdown useful for your work.

Unfortunately, the bug you have reported is really strange.
Do you mind sharing the header and the first few lines of your .Rmd document? This will allows us to evaluate what caused the problem.
And also, which operative system do you use? Different character encoding between OS sometimes triggers some problems.

For a quick solution to the problem:

  • When downloading the file from google drive with the download_file() function, if trackdown fails to retrieve the [[document-header]] tag, the code is automatically restored at the first line of the document. Was the code not restored at the first line in your case? The following message is printed in the console:
Warning message:
Failed retrieving [[document-header]] placeholder, code added at first line 
  • Alternatively (a little bit raw πŸ˜…), you could simply add "[[document-header]]" in the document on google drive, on a new line right after the instructions. This should be enough for trackdown to correctly retrieve the tag when downloading.

from trackdown.

ClaudioZandonella avatar ClaudioZandonella commented on May 25, 2024

Hi @weiyangtham,

We are really happy to know that you are excited about the package! And thank you for reporting this issue...unfortunately, I can not reproduce the issue and it is really strange to understand why this happens.

Do you find the same issue on different documents as well?

To find out where is the problem, could you please follow these instructions?
I have created a small report that will execute all the steps done by trackdown to find and substitute the header code. This will help us to understand at which point the issue emerges. Could you please compile the report and share the results?

I attach a zip folder with the Debugging-issue-17.Rmd file. Could you:

  1. download and unzip the file
  2. move it in the same folder as your Rmd document that presents the issue
  3. open Debugging-issue-17.Rmd
  4. at line 24 you have to indicate the name of your Rmd document (with extension)
  5. compile Debugging-issue-17.Rmd

If everything goes smoothly in the output you can find several checks to evaluate where the problem is. If you upload the output I can try to fix the issue.

Note that I have truncated the output of several chunks in order to print only relevant information and not your entire document, feel free to adjust if required.

Debugging-issue-17.Rmd.zip

from trackdown.

weiyangtham avatar weiyangtham commented on May 25, 2024

Done! Let me know if you need anything else
document-to-upload.txt

from trackdown.

ClaudioZandonella avatar ClaudioZandonella commented on May 25, 2024

Hi @weiyangtham,

Could you please upload the html output you obtain when compiling Debugging-issue-17.Rmd, so I will be able to understand at which step the error occurs.

Note that to upload a html file in GitHub you have to zip the file

Thanks for your help!

from trackdown.

ClaudioZandonella avatar ClaudioZandonella commented on May 25, 2024

Hi @dfranquesa,

The problem you referred to in issue #20 is caused by the same problem discussed here. For unknown reasons the [[document-header]] tag is missing and 1 is placed instead. This is really strange also because when downloading, instead of restoring the header code, again another 1 is placed.

Unfortunately, I can not reproduce this error on my computer. Could you please help us to understand the reason behind this error?

To find out where is the problem, please follow these instructions. I have created a short report that will execute all the steps done by trackdown to find and substitute the header code. This will help us to understand at which point the issue emerges. Could you please compile the report and share the resulting output (an HTML file)?

I attach a zip folder with the Debugging-issue-17.Rmd file. Could you:

  1. download and unzip the file
  2. move it in the same folder as your Rmd document that presents the issue
  3. open Debugging-issue-17.Rmd
  4. at line 23 you have to indicate the name of your Rmd document (with extension)
  5. compile Debugging-issue-17.Rmd

If everything goes smoothly in the output you will find several checks to evaluate where the problem is. If you upload the output (the HTML file) I can try to fix the issue.

Note that I have truncated the output of several chunks in order to print only relevant information and not your entire document, feel free to adjust if required.

Thanks for your help!

Debugging-issue-17.Rmd.zip

from trackdown.

weiyangtham avatar weiyangtham commented on May 25, 2024

Hi @ClaudioZandonella , here's the html file!
Debugging-issue-17.html.zip

from trackdown.

dfranquesa avatar dfranquesa commented on May 25, 2024

@ClaudioZandonella I can not say the same as @weiyangtham
Still not works for me.
I've update to Version: 1.0.1, 2021-08-28 15:04:24
Please find attached a zip file with all the info I think you are asking for debugging.
I'm using Ubuntu, I've add also the session_info.html.
Thanks!
David
Debugging-issue-17-DFG.zip

from trackdown.

ClaudioZandonella avatar ClaudioZandonella commented on May 25, 2024

Hi @dfranquesa,

thanks for your help!

Looking at your session_info.html I see
## V trackdown * 1.0.0 2021-08-28 [1] Github (claudiozandonella/trackdown@9445154)
with
## V ── Loaded and on-disk version mismatch.

Probably you installed the new version of the package but tho old one was still loaded. Maybe restarting the rstudio session will solve the issue. You need the version 1.0.1 to be loaded.

To be sure that the new version is loaded you can run the following commands

name_your_file <- "bug_trackdown_header.Rmd"   # path to your file
original_text <- readLines(name_your_file)
info_patterns <- trackdown:::get_extension_patterns("rmd")
head_info <- trackdown:::extract_header(original_text, info_patterns)
str(head_info)

the result should be

'data.frame':	1 obs. of  4 variables:
 $ starts     : int 1
 $ ends       : int 6
 $ header_text: chr "---\ntitle: \"Analysis Script\"\nauthor: \"David Franquesa, Mireia Roura, Leandro Navarro\"\ndate: \"`r format("| __truncated__
 $ name_tag   : chr "[[document-header]]"

If header_text and name_tag are type chr the new version is working. Instead, if they are still type factor, the old version is working.

Again, thanks for your help!
Claudio

from trackdown.

ClaudioZandonella avatar ClaudioZandonella commented on May 25, 2024

Thank you all for your help!

Anyone who finds the same issue, please, install the package version v.1.0.1 from GitHub with

# install.packages("remotes")
remotes::install_github("claudiozandonella/trackdown",
                         build_vignettes = TRUE)

from trackdown.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.