R Working Directory "cannot change" - r

Working Direcotry Cannot Change It's saying that there's an error in my code but I've tried it multiple times with countless variations on the code (I wiped my past attempts sorry) and it refuses to change the working directory. It won't change to other things either so it's not just this folder. What's the issue?

This probably means that the directory you want to change to does not exist. From the image I think you are using Windows, in which case the proper path to the directory would look like this:
setwd("C:/Users/$USER$/Desktop/r-novice-inflammation"
Change the $USER$ to your own username and it should work.
Paths always start with the letter of the hard drive in Windows. The easiest way to find the proper path to a directory is, in my opinion, to right click on the folder and look for the "Location" in properties. The IDE RStudio has a menu which you can use to change the working directory, which may be easier than using vanilla R.
The exception is setwd("~") which links to the Documents folder of your current user (i.e. C:/Users/$USER$/Documents). Based on the comments I realised that other commands such as setwd("..") (i.e. one folder up in the hierarchy) can be combined with ~ which explains what you are doing. In this case the following works for me:
setwd("~/../Desktop/")

Related

Is there a way to use a getExistingDirectory for folders with the same view that getOpenFileName uses

I've made a small app to convert folders into CBZ format, but when prompting the user to select a folder, the QFileDialog.getExistingDirectory method uses a tree view that I really don't like. The getOpenFileName have a standard view of the filesystem, but it only works for files and not directories.
My idea is to:
Make getExistingDirectory change it's view mode
Use or some getOpenFileName variation to load folders
I've tried using TK instead for the file dialog, but it is even worse on UI terms, so it's a no go for me.
Setting FileMode to Directory seems to not work at all (or maybe I'm doing something wrong, but the docs are really bad for that).
Following ekhumoro's suggestion and using the DontUseNativeDialog worked. It may look bad on Gnome, but on Plasma it looks better.
This is the line to call the dialog:
self.folder = QFileDialog.getExistingDirectory(self, 'Abrir pasta', home_directory, QFileDialog.DontUseNativeDialog)

Scene Builder isnt starting in Netbeans cause of non-English Letters in Path

my Problem is the follows. My Notebook is owned by my employer, so i cant really change my Username. I have Admin rights whatsoever, but he made my Username with an 'ö' in it.
That really messes up most things that come up with parsing Paths.
So right now. After hours spent, i finally made JavaFX in NB to work. Not with a build-up jar, but at least in the IDE. For the Jar i gave up for now.
But the Scene Builder just throws a FNF-Exception. The Path shown is the correct one (generated by the IDE), but the "ö" is awfully missplaced. So i think it cant read the Path. NB is started with UTF-8 and every code i wrote so far i managed to do a workaround for that.
But not for this.. i dont know where i should specify a charset for that, if its even possible. i cant change the Path, so i have to get this to work.
Any hints?

Ado Brackets Efficient File Finder

Is there anyway Adobe Brackets Editor find a file as fast as typing a filename and avoid going through the sidebar? Much like finding a text with ctrl-f?
As others have mentioned – use Navigate > Quick Open, which you can also access via the shortcut Ctrl-Shift-O.
Quick Open is very powerful: you can type just an abbreviation or parts of a filename to find it with less typing. For example, typing "fbu" or "fooutil" will find "FooBarUtils.js".
Edit:
to answer the question about scope... Quick Open searches in your entire project. Brackets treats the root folder you have open (the root of the folder tree you see at left) as your project. To choose a folder, choose File > Open Folder.
There's no way to restrict Quick Open to just a subfolder within that project, but you can type part of a folder name and Quick Open will factor that into the search results. For example, typing "foo/bar" or even "fbar" will list "foo/bar.js" or "foo/xyz/bar.js" higher in the results. This is useful if you have many files with similar names within your project.

Change Working Directory (pwd) to Script Location in Stata 12

I have a lot of scripts (.do files) in different folders, which are frequently moved around. I would like to have Stata detect where the script is, and use that as a pwd (working directory). I know people that have this functionality seemingly by default (the pwd is changed to the script location when the script is run), but we cannot figure out why I am not so lucky. It is a bit tedious always having a "cd" line at the top of my scripts, and having to change this line to reflect the current directory. I'm using Stata 12 with Windows 7 Professional.
It looks to me like something similar is answered in this question:
Paths to do-file in Stata
What it seems like you could do is keep an MS Excel file that somehow tracks the location of all your scripts, and then use that to generate a simple high-level do-file that calls all your programs (although this may not be how your scripts work). If your folder locations are changing I am not sure how you can completely avoid updating at least some lines of code when something gets moved around. This would at least centralize the necessary updates into one place.
You can use Sublime text.
https://sublime.wbond.net/packages/Stata%20Enhanced
When you build the do file (or a selection) using sublime text, the filepath of the do file automatically becomes the current directory.

Compilation errors setting up Box2D with Cocos2d in Xcode

I notice several other people have had similar problems, however this is a bit strange...
I have a new install of scode 4.2 and the most recent cocos2d from a few weeks back. I have changed all files that include Box2D to the C++ .mm file extension. I have also set a user header search path for appName/libs**.
When I compile either b2BroadPhase.cpp and/or b2CollideCircle.cpp are missing, or even more rare, Box2d.h is missing. I have checked and all of these files are in the correct location in my applications directory.
Can anyone tell me why the files are not being found and why the number of files missing is randomly fluctuating?
EDIT:
Ok, so I obviously don't understand Header Search Paths... Are they designed to point towards folders that wouldn't normally be searched? If I add a Header Search Path then I get 200+ errors saying box2D files cannot be found. If I don't add a header search path I get 1-3 errors saying files cannot be found.
Your issue is that you have set the "User Header Search Path". However, Box2D requires you to specify the path in the "Header Search Path" build setting. This is because Box2D is using C++ style angle bracket include statements:
#include <Box2D/Dynamics/b2Body.h>
If that should not solve the (or all of the) problem(s), check this:
If you assume the same Box2D path as it is in cocos2d-iphone:
cocos2d-iphone/external/Box2d/Box2D
Then your Box2D Header Search Path must point to
cocos2d-iphone/external/Box2d/Box2D
You may have specified the "Box2d" folder instead of the "Box2d/Box2D" folder. That is also a common mistake.
Your header search paths are most likely wrong. Would you mind posting what it is?
If your Box2D folder is in your Xcode folder (look in finder), it should be as simple as this:
$(SRCROOT)
or
$(SRCROOT)/Box2D
My problem was that I was having an #import "Box2D.h" statement on a file with a ".m" extension instead of ".mm" .. Changing the file extension (select file, press enter, add extra "m") got rid of all the box2d errors.
Hopefully this helps someone else!

Resources