R Studio Viewer issue [closed] - csv

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I am running the folliwing code:
trial = read.csv("trial.csv",
header = TRUE,
sep = ",",
na.string = "NA",
skip = 0,
strip.white = TRUE,
stringsAsFactors=FALSE
)
which I've successfully run for 3 previous datasets. No problem, I eventually merged them and did my stuff.
However, on this one I can't understand what's going on: the dataset doesn't open. I've tried to see which column was giving me the problem and it is the sixth
x<-trial[6]
which is the only numeric one. So i thought it was a conversion problem (the string one, even if I put the code in the import one.
But it is not this problem, since when I run
str(trial)
it gives me num, as it should.
It's been a week I've been trying to solve this apparently simple problem but I can't pull though.
EDIT2 The IMF dataset I0m using can be freely downloaded at this link. You need to register (free) to do the bulk download at the top right. I'm not sure if this is the right way to link a dataset, pls let me know.
When you download the dataset, just choose one country (e.g. Italy) and leave the option "all indicators".
EDIT. There is no shown error message.

Related

/Download JSON and only update if there is a change. Can Firebase do this? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I plan on having a massive JSON, ~20MB, and I am creating a React Native App using the JSON. I want to have the app:
Download only the changes to the JSON.
or at least
Download only if changes have been made (which will be less than once a month).
If there is something better than Firebase I would be fine switching over to that.
I had the same issue, a huge JSON object which change once a week. the way that I solved this issue is as following
lets say that we have an object O ~20MB
I created in my firebase db the object data = {raw: O, update: Date()}
on the client side I checked /data/update and compare it to the user localStorage. if it changed I replaced the user`s localstorage object, otherwise skipped.
In this way you dont need to download the whole O only to fetch the date object
it looks like
const {update, raw} = localStorage.fetch('/data')
const last_update = firebase.fetch('/data/update')
if(update === last_update){return raw}
const new_raw = firebase.fetch('/data/raw')
localStorage.save('/data', {update: last_update, raw: new_raw})
return new_raw

Create individual files from 1 CSV [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm extracting data from a MySQL database creating a CSV file with two columns: ID and Text. I would like to know an easy way (SQL, text editor or R solutions) to create a text file for each row containing the second column (text format) with the ID from the first column as the name of the text file. Any ideas? Thanks in advance.
In R I would do the following:
for(i in 1:nrow(df)){
write.table(df$Text[i],
file = paste0(df$ID[i], ".txt"),
col.names = F, row.names = F)
}
list.files()
# [1] "1.txt" "10.txt" "11.txt" "12.txt" "13.txt" "14.txt" "15.txt" "16.txt"
# ----
# "76.txt" "77.txt" "78.txt" "79.txt" "8.txt" "80.txt" "81.txt" "82.txt" "9.txt"
I did a loop based on what you said #Ken S. but it's 90,000 rows that need to be converted into individual files. The R loop is only able to produce 5 per minute, which means it would take several days to finish. Thanks though!
for (i in 1:91020) {number=descriptions[i,1]
text=descriptions[i,2]
print(text)
write.table(text,file=paste0(number, ".txt"))}

Find and remove specific text from CSV file with batch file [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a CSV file with many rows and columns (like an Excel file), I want a batch file that can find 'PaperCut Print Logger - http://www.papercut.com/' from first row-first column and if it exists, removed it.Also i want batch file makes a new CSV without that row and with other content.
Also I want this file to be executed whenever a row is added to the table.
what can i do for that???
i want batch file coding.
if you have to use Batch, there is a single command for that:
find /v "PaperCut Print Logger" <Input.csv > Output.csv
which will technically delete all lines, that contain the string PaperCut Print Logger, but I guess, that fits your needs.
makes a new CSV without that row and with other Content? new Content for the first line only?
echo this is the new first line>Output.csv
find /v "PaperCut Print Logger" <Input.csv >>Output.csv

Flash AS3 suddenly unable to delete values from objects [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
This is fairly interesting. Flash CS6 has suddenly lost the ability to iterate through objects and delete their values (which did work before)
Delete all values from object keys
for each(var key:String in ScoreKeep.scoreCard)
ScoreKeep.scoreCard[key] = 0;
The object (ScoreKeep.as)
static public var scoreCard:Object = {
"Fish":6, "Golfball":2, "Gloves":8, "Boot":4,
};
You can trace the object key. The value will still be there.
You are using it wrongly, it is not supposed to be for each but for. for each would take the value, not the key.
You also have a "," after the last prop in your object, I assume that's a typo (and should result in a compile-time error).

Making an API (Wordpress) Date usable with Coldfusion [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
Scratching my head a bit with this one folks!
I'm using the Wordpress API to return posts & comments, which I then need to add to a local database (MySQL) using ColdFusion. I keep hitting a stumbling block with the dates returned though.
I'm using cfhttp with the API, then DeserializeJSON to work with the data returned.
An example date being returned is - 2013-06-25T17:20:24+01:00
When I run #CreateODBCDateTime(thedate)# I get the following error;
2013-06-25T17:20:24+01:00 is an invalid date or time string.
I'm pretty sure I've worked with dates in this format the same way before, without any errors - so I can't see why this one is failing.
Here is valid code to reproduce the issue.
<cfset theDate = '2013-06-25T17:20:24+01:00'>
<cfdump var="#CreateODBCDateTime(theDate)#">
Well I didn't spot this when I searched before posting, but I saw it appear in the 'related' area - ColdFusion - DateTime Format with GMT offset
The top solution, using the UDF has sorted the issue for me.
I would use the parseDateTime function
<cfset myDate = '2013-06-25T17:20:24+01:00'>
<cfset myDate = parseDateTime(myDate)>
<cfdump var="#myDate#">
This dumps out {ts '2013-06-25 11:20:24'}