2 Pthc Liluplanet Lordofthering Kat I can paste the whole dataset here. I would like to write a loop that reads through the whole file and pastes the desired file with same YYYYMMDD format like before but also adds the col_0 and col_1. I have tried using paste together with a regular expression but I fail to adapt it to my needs because I get the error message paste requires 3 or more arguments When I try a loop like this it works: paste(row_to,col,file,sep="\t",header=FALSE,fileEncoding="UTF-8") I would like to avoid this solution because it is too messy and it does not solve my problem. I have also tried using strsplit but I fail to adapt my trial and error with this solution to my problem. I would like to ask you how to get this done with a loop in R. In the example file below the desired outcome is 20170211 288455 kingfisher closeout brockovich best key 2 pthc liluplanet A: Try this one library(lubridate) library(lubridate) library(stringr) dd = c(paste(rep("2017",6),"02",rep("11",6)),rep("313",2)) file = 'file.txt' col = 1:4 str_c = sprintf('%s%02d', col, dd) file_formatted A: "var ob = {}; ob.1 = ob; ob.4 = ob; ob.3 = ob; ob.2 = ob; ob.6 = ob; ob.5 = ob;" - ob.1, ob.4, ob.3, ob.2, ob.6, ob.5 "ob.%s = ob; ob.%s = ob;" - ob.4, ob.3, ob.2, ob.1, ob.6, ob.5 "ob[1] = ob; ob[2] = ob; ob[3] = ob; ob[4] = ob; ob[5] = ob; ob[6] = ob;" - ob[1], ob[2], ob[3], ob[4], ob[5], ob[6] I believe it's a quirk of the eval() parsing. It's explained here But I don't recommend using it in production code. Q: GPS data prediction with google earth Recently I have been playing with the data google provides on the planet api. I have been playing with the proccessing technique (google earth plugin) and trying to extract some info like the sunrise/sunset for the locations I have. I have this data structure: _ge.getLocation() _ge.getLocationApi() _ge.getLocationApi() And so far they both provide me the exact same location, I have made sure I have the correct API's enabled by asking the API dashboard and confirming that the location is correct. But what I am trying to do is get a prediction on the sunrise/sunset time for that location for any time I request, however so far I am only getting the last time. Does anybody know where I am going wrong or how to do this? A: From the map API docs: The location_converter.createLocation method can also be used to convert a string to a location object. It constructs a Location object from the given string, using either the GPS (based on the passed GPS string) or the network location. With that in mind, perhaps try this: var predict = ge.createLocation('37.333044,-122.036641 648931e174
Related links:
Comments