I followed this blog post and was 99% successful with accomplishing what I wanted to. Basically, create an R Notepad file (.Rmd), run it and save file. Then, run the code that is in the blog post and have my .Rmd file automatically upload to my WordPress site.
The problem is that it uploads and changes the single and double quotes to "'";, """ with semicolons at the end, "&" respectively.
Example, my code looks like this: LoggerFile = 'SOLAR_LOGGER'
When uploaded to WordPress and I look at the post via text only, it shows up like this: "LoggerFile = ' ;SOLAR_LOGGER' ;"
Only without the space between ";" and the 9.
When I publish, it still shows "LoggerFile = ' ;SOLAR_LOGGER' ;" as well.
I know at one point I messed with my WordPress files to try and implement using pretty print for code which worked. I would normally manually enter "< pre>< code>Code Here" and it would prettify my code. This still works.
A side question: I was trying to post to another WordPress site to see if it was just that particular WordPress configuration but it doesn't seem to want to change sites. I stored site and password in the .Rprofile file. I tried to even put .Rprofile in same directory with no luck. The changes don't take effect, even after restarting R.
I am very new to R so I may be missing some key pieces of the puzzle. I am also new to MacOS and using terminals. Learning quickly and getting the hang of it (loving it as well!).
I'm using WordPress Version 4.9.1
Hosting under godaddy account (sorry!)
R Studio Version 1.0.153
R version 3.4.1 (2017-06-30)
macOS Sierra Version 10.12.6 (16G1036)
Any suggestions?
So the answer ended up being a conflict between knit2wp and a Crayon add in for WordPress.
The solution is detailed in this post I found [here][1]. Essentially, the code will modify the contents to work well with the Syntax Highlighter built in.
They change knit2wp to knit2wpCrayon. I just tried it and it works perfect. This is good because I won't have to modify any of my old posts.
Related
Console My ## tag is not changing color, what can I do to change that?
I have tried looking for a solution in my settings, but there has been no luck.
The console isn't a place to make and keep notes. The console isn't something that gets saved, so if you are trying to add notes to a script, you probably want to create a new script.
In R itself, I am not sure if or how you have notes (in scripts) change colors, but this happens automatically in some "Integrated Development Environments (IDE)", such as RStudio. For learning how to use R, I would recommend downloading RStudio. When you create a script there, your comments starting with # will automatically be a different color than code.
I've recently started to use the Atom editor again because it offers some good features.
However it doesn't recognize the code in my files most of the time.
I use it mainly to look through SSIS files - meaning they are in XML-format but have other file endings like ".conmgr" or ".dtsx". Yet they all start with <?xml version="1.0"?>.
Now to my question:
Can I somehow set the standard language from "Auto Detect" to "XML" or is there any package so that Atom starts to recognize those files as XML-code?
Since this is my first time using stackoverflow to ask something I hope I've done everything right.
Thank you in advance!
The two picures show two different files. Both ending on ".conmgr":
This file it does recognize
This file it doesn't
Occasionally I had not saved my source script, and its old version opened. I can find the new version which was executed during the previous session, but only like shreds: I search in history and it shows me a piece of code, but not all lines though they were executed simultaneously. Is there any way to access the complete history, which is definitely stored somewhere, but not shown as a whole? Thanks!
I am using R version 3.6.2 and RStudio Version 1.2.5033.
Search for the "history_database" file. It is an ASCII file and it is usually stored in the folder
C:\Users\username\AppData\Local\RStudio-Desktop
Please, take a look at: https://support.rstudio.com/hc/en-us/articles/200526217-Command-History
use shortcut key Ctrl + 4 to put focus on history or Ctrl+Shift+4 to enlarge window of history. Let us know
Here is a screenshot of what's happening to my wordpresss template code time after time:
https://www.box.net/shared/zrql76wiimr790587yxj
I thought at first it was a notepad++ problem. But this occured also on phpstorm.
Any idea why that's happening?
Your code isn't messed up, this is a question about how your system handles lineendings.
Linux and OSX save lineendings differently from Windows.
Linux and OSX saves lineendings with a Line Feed (LF):
\n
While windows saves it with Carriage Return + Line Feed (CR+LF):
\r\n
So what is probably happening is that your file has been written on a system that doesn't save lineendings in the windows format. Your editor most probably supports these kind of line endings and can handle it, look into the menus of your editor.
** Below is part of an edit and not part of my answer.**
You can check EditorConfig which can be helpful when you are trying to keep settings across projects and/or editors and also, if you keep your code under git, Dealing with line endings article from Github may be also helpful.
End of edit
Read more here: Wiki article
I am trying to do some work for my thesis which has me using the R programming language (and the R app on Mac OS Lion) for the first time. I had to download the files from here to work with but none of the files comes in .rda or .r they all come in different file extensions. Can someone please tell me how to either convert or use these files?
This page might be relevant to your interests. Also note that if you click on the link on that page that says "Analyze with GEO2R" you can get an R script created for you that will do some of the legwork for you. I would highly suggest reading the instructions on that page in order to get things prepared the way you want them to be.