I've encountered a very bizarre problem with my R scripts. I had a bunch saved in a folder, and after reinstalling R (which was itself having some issues), the rather large scripts I had can easily open in R, but appear to have no text on them (this is despite it clearly labeled as an R document in the folder and being 26kb). Yet when I upload my scripts in a message on Slack, it appears perfectly fine.
Here is what my R script looks like presently:
And this is what it should look like:
I'm thinking it has something to do with the way R is reading the text in the script, but I couldn't find any answers online that were helpful. I would greatly appreciate any advice, as I dont' want to have to recreate all of these using Slack of all things...
I figured it out with some tinkering and it was a rather simple fix that mirrored what I thought the issue was. Apparently my RStudio program was set to read the text in CP936 format. I set it to system default:
And viola! My text is now back!
I am currently writing my bachelor thesis using Rmarkdown, and whenever i make changes I knit to PDF to check how it looks etc.
It worked perfectly until I wanted to check some small changes and after that I canĀ“t get it to knit, this is the error message I get:
output file: bbb.knit.md
! Text line contains an invalid character.
l.28 pdftitle={^^K
space{3.5in} Portfolio},
Error: Failed to compile bbb.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See bbb.log for more info.
Bare in mind that I am learning R while writing my thesis so I do have a very low level of knowledge. Does anyone have any suggestions for where the mistake might be? Line 28 has no text by the way.
I have read some suggestions about deleting the auxiliary file but I dont even know what that is or where to find it, or if it could cause me any problems deleting it.
Hope someone has some tips as wasting a lot of time on this is the last I need right now! Thanks
The solution was to change the title input in YAML from "\vspace{3.5in} Portfolio"
to only "Portfolio".
Ok recently I have been experimenting with Julia's compose.jl and have run into a somewhat confusing problem. I will run the standard code to initialize the package.
Pkg.add("Compose")
using Compose
compose(compose(context(), rectangle()), fill("tomato"))
And then run that code. Here is my problem: the code executes fine, it's the output that is strange. The typical output for this code would be a red rectangle. The output I get when this code is run is this:
Context(BoundingBox(Measure{MeasureNil,MeasureNil}(0.0,MeasureNil(),MeasureNil(),0.0,0.0),Measure{MeasureNil,MeasureNil}(0.0,MeasureNil(),MeasureNil(),0.0,0.0),Measure{MeasureNil,MeasureNil}(0.0,MeasureNil(),MeasureNil(),1.0,0.0),Measure{MeasureNil,MeasureNil}(0.0,MeasureNil(),MeasureNil(),0.0,1.0)),UnitBox{Nothing,Nothing,Nothing,Nothing}(nothing,nothing,nothing,nothing,Measure{MeasureNil,MeasureNil}(0.0,MeasureNil(),MeasureNil(),0.0,0.0),Measure{MeasureNil,MeasureNil}(0.0,MeasureNil(),MeasureNil(),0.0,0.0),Measure{MeasureNil,MeasureNil}(0.0,MeasureNil(),MeasureNil(),0.0,0.0),Measure{MeasureNil,MeasureNil}(0.0,MeasureNil(),MeasureNil(),0.0,0.0)),Rotation{Point{Measure{MeasureNil,MeasureNil},Measure{MeasureNil,MeasureNil}}}(0.0,Point{Measure{MeasureNil,MeasureNil},Measure{MeasureNil,MeasureNil}}(Measure{MeasureNil,MeasureNil}(0.0,MeasureNil(),MeasureNil(),0.5,0.0),Measure{MeasureNil,MeasureNil}(0.0,MeasureNil(),MeasureNil(),0.0,0.5))),nothing,ListNode{ComposeNode}(Property{FillPrimitive}([FillPrimitive(AlphaColorValue{RGB{Float64},Float64}(RGB{Float64}(1.0,0.38823529411764707,0.2784313725490196),1.0))]),ListNode{ComposeNode}(Form{RectanglePrimitive{P<:Point{XM<:Measure{S,T},YM<:Measure{S,T}},M1<:Measure{S,T},M2<:Measure{S,T}}}(RectanglePrimitive[RectanglePrimitive{Point{Measure{MeasureNil,MeasureNil},Measure{MeasureNil,MeasureNil}},Measure{MeasureNil,MeasureNil},Measure{MeasureNil,MeasureNil}}(Point{Measure{MeasureNil,MeasureNil},Measure{MeasureNil,MeasureNil}}(Measure{MeasureNil,MeasureNil}(0.0,MeasureNil(),MeasureNil(),0.0,0.0),Measure{MeasureNil,MeasureNil}(0.0,MeasureNil(),MeasureNil(),0.0,0.0)),Measure{MeasureNil,MeasureNil}(0.0,MeasureNil(),MeasureNil(),1.0,0.0),Measure{MeasureNil,MeasureNil}(0.0,MeasureNil(),MeasureNil(),0.0,1.0))]),ListNull{ComposeNode}())),0,false,false,false,false,nothing,nothing,0.0)
a rather lengthy piece of text that doesn't show the shape... I am wondering if this is an error or if I am just doing something wrong. Does anyone know how to make this output what it should be?
One possibility to open an image through REPL would be through TerminalExtensions.jl. But generally I believe you have to write the image to a file and then open it. To save the file use this,
julia>draw(PNG("test.png", 10inch, 10inch), compose(compose(context(), rectangle()), fill("tomato")))