Opening shapefile in RMD - r-markdown

I'm running into a persistent error in RMD. I'm trying to open a shapefile that is in my RMD directory ("website/"). When I run the code to open the shapefile, it looks like this.
data <- st_read("website/website_data.shp")
Error: Cannot open "website/website_data.shp"; The file doesn't seem to exist.
I've used file.exists and list.files and both say website_data is in the folder. What am I missing?

Related

error in indirect file load in Informatica

I am trying indirect file load in Informatica.
I put below files in $PmSrcFilesDir (from here the workflow task pick up files)
-list.txt
-production_plan_20210906.csv
-production_plan_20210907.csv
The list.txt files contains the csv file names only.
I configured below options:
Source filetype- Indirect
Source filename- list.txt
Source file directory- $PMSourceFileDir
After running the workflow it shows error- as
FR_3000 Error Opening File...No such file or directory
You can give absolute path in list.txt.
/Path/to/file/production_plan_20210906.csv
/Path/to/file/production_plan_20210907.csv
You can use command task or shell script to get absolute path and file name.
Pls check session log, which file it cant read - list file or main file. If list file mention $PMSourceFileDir correctly in param file.
Now, make sure informatica user (user that runs infa server) has read access to those data, list folders and files. Admin can help.

Unable to open SAS EG Project

I can't open my SAS EG Project with the error message :
"Unable to open file ...abc.egp as valid project file"
This is happen because when my hard disk is full and I was trying to save the project, so it wouldn't let EG to finish writing the project changes.
I've tried to clear the history but no luck.
Thanks
I suspect your SAS EG file might be irreversibly corrupt, so the focus is then on recovery of the file or its content.
If your disk drive is NTFS based, you might be able to recover the file. Check for previous versions in the file properties.
Also, what was the structure of your file inside? If it was a code driven program, then you can make a copy of the file, change extension to "zip" and then unzip the file or look inside for its contents. SAS EG projects are just ZIP archives with XML maps and related SAS code.
The last option is to see if you have logging enabled in your SAS EG. If you do, then all the code you run on that date would be available in your logs, so you can recover the code from the logs.
Regards,
Vasilij

MarkLogic: where should I place the XSLT code when testing xdmp:xslt-invoke in the qconsole

I have tried adding it to the database associated with the query that's being run, in the folder of the qconsole itself and in the Modules db, but I still get the error message: "File open error: open '/to-html.xsl': No such file or directory"
This is the code I'm trying to run:
xdmp:xslt-invoke("to-html.xsl", fn:doc('/docs/before-1.xml'))
Generally, the path given to xdmp:xslt-invoke will resolve relative to your modules root. But there is a more complex set of rules about the order MarkLogic will use when evaluating paths explained in the documentation:
https://docs.marklogic.com/guide/app-dev/import_modules#id_29407

PyAIML not loading startup

I am beginning a project on Python that implements PyAIML and I wrote the following code to create a brain for my project:
import aiml
k=aiml.Kernel()
k.learn("std-startup.xml")
k.respond("LOAD AIML B")
k.saveBrain("jarvis.brn")
When I run the program I get this error: WARNING: No match found for input: LOAD AIML B
I understand that I needed to download an AIML set to begin development. So I did, but I'm stuck there.
Please help. I'm a noob programmer so don't be rough on me for this dumb mistake.
Thanks in advance!
The .learn() method will not throw an error if the file you pass it does not exist, and I'm guessing that you are trying to learn patterns from "std-startup.xml" without having this file in your directory.
Make sure the file std-startup.xml is in the directory you are running your script from. You should also have a directory called standard in your working directory that contains the standard set of aiml files. Basically your directory should look like this:
mydir/my_script.py
mydir/std-startup.xml
mydir/standard/a-bunch-of-std-aiml-files.aiml
These files can be found in the "Other Files/Standard AIML Set/" folder on the pyaiml source forge site. Go to that folder and download the one of the tarballs or the zip.
A few things:
If your AIML is loading properly, pyAIML will respond with a line that will read something like:
Loading std-startup.aiml... done (1.00 seconds)
It will not necessarily throw an error if it does not find a file to load, so if you don't see this line, pyAIML has not loaded the AIML file.
I don't see 'std-startup.xml' in the sourceforge directory either, but this shouldn't matter. All that you're loading is any AIML file that will allow you to test the kernel. Try loading the 'self-test.aiml' file in the /aiml directory instead. (Double-check to make sure the file suffix in your code is .aiml and not .xml)
k.respond() is for giving the bot some input and 'LOAD AIML B' is just a test phrase. Once you've loaded 'self-test.aiml' try k.respond('test date') and you should get
The date is Wed Mar 13 01:37:07 2013 in response.

WAMP: failed to open stream: No such file or directory

I'm trying to upload a file using PHP. My HTML page with the form is stored at
C:\wamp\www\myproject\upload.html
PHP page is
C:\wamp\www\myproject\upload.php,
and the file I'm trying to upload is
C:\wamp\www\myproject\openoffice.txt.
When I try to upload the file, I get the following error:
Warning: move_uploaded_file(/uploads/openoffice.txt) [function.move-uploaded-file]: failed to open stream: No such file or
directory in C:\wamp\www\myproject\upload.php on line 40
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\wamp\tmp\phpF66A.tmp' to '/uploads/openoffice.txt'
in C:\wamp\www\myproject\upload.php on line 40 Problem: could not move
file to destination directory
Here are lines 40-43 of upload.php:
if (!move_uploaded_file($_FILES['userfile']['tmp_name'], $upfile)) {
echo 'Problem: could not move file to destination directory';
exit;
}
The fact that it's looking in upload.php instead of the folder that it's in makes me wonder whether it's a server error or an issue with my PHP.
I Googled and got this advice but I don't know if it's the right advice, or how to implement it. Help?
You should be supplying a file system path for $upFile, not a web based path. try using the full system path to you your uploads directory like C:\path\to\uploads\openoffice.txt. Unless of course youre actually trying to place the file in C:\uploads...
Try this code
$imgName = time();
$imgPath = BASEPATH."../uploads/".$imgName;
$image = base_url().'uploads/'.$imgName;
move_uploaded_file($_FILES["file"]["tmp_name"],$imgPath.".jpg");
$imageNew =$imgName;
Where uploads is the folder name just rename it with your folder name or make your folder as name it as uploads. Its working code.
Thanks
Give your '/uploads/' folder where you are going to upload your file. 777 rights. Give full permission to that directory.