[R] Help with Regular expression

2018-01-03 Thread Christofer Bogaso
Hi, I was working on following expression : "\":\"03-JAN-2018 16:00:00\"" This is basically a combination of Date and Time mixed with some Noise. I want to extract only Date and Time part i.e. "03-JAN-2018 16:00:00 I tried following : gsub("![0-9][0-9]-[a-zA-Z][a-zA-Z][a-zA-Z]-[0-9][0-9][0-9

[R] How to programmatically save a web-page using R (mimicking Command+S)

2018-01-06 Thread Christofer Bogaso
Hi, I would appreciate if someone can give me a pointer on how to save a webpage programmatically using R. For example, let say I have this webpage open in my browser: http://www.bseindia.com/stock-share-price/dabur-india-ltd/dabur/500096/ When manually I save this page, I just press Command+S

Re: [R] How to programmatically save a web-page using R (mimicking Command+S)

2018-01-13 Thread Christofer Bogaso
wondering if there is any other direct ways to achieve the same. Thanks, On Sat, Jan 6, 2018 at 7:14 PM, Henrik Bengtsson wrote: > The 'webshot' package (on CRAN) can do this. > > Henrik > > On Jan 6, 2018 05:27, "Christofer Bogaso" > wrote: >> >> H

[R] Change Function based on ifelse() condtion

2018-03-04 Thread Christofer Bogaso
Hi again, I am looking for some way to alternately use 2 related functions, based on some ifelse() condition. For example, I have 2 functions mclapply() and lapply() However, mclapply() function has one extra parameter 'mc.cores' which lapply doesnt not have. I know when mc.cores = 1, these 2 f

Re: [R] Change Function based on ifelse() condtion

2018-03-04 Thread Christofer Bogaso
urdoch wrote: > On 04/03/2018 10:39 AM, Christofer Bogaso wrote: >> >> Hi again, >> >> I am looking for some way to alternately use 2 related functions, >> based on some ifelse() condition. >> >> For example, I have 2 functions mclapply() and lapply()

Re: [R] Change Function based on ifelse() condtion

2018-03-04 Thread Christofer Bogaso
%in% 'mc.cores'] > > HTH, > Eric > > On Sun, Mar 4, 2018 at 6:38 PM, Christofer Bogaso > wrote: >> >> Hi, >> >> As an example, I want to create below kind of custom Function which >> either be mclapply pr lapply >> >> Lapply_

Re: [R] Change Function based on ifelse() condtion

2018-03-04 Thread Christofer Bogaso
e FUN argument is not expecting extra arguments. > > HTH, > Eric > > > On Sun, Mar 4, 2018 at 6:52 PM, Christofer Bogaso > wrote: >> >> @Eric - with this approach I am getting below error : >> >> Error in FUN(X[[i]], ...) : unused argument (list()) >&

Re: [R] Change Function based on ifelse() condtion

2018-03-04 Thread Christofer Bogaso
pass anything that how is FUN declared? > You have not shown that in your email. > > > > > On Sun, Mar 4, 2018 at 7:11 PM, Christofer Bogaso > wrote: >> >> My modified function looks below : >> >> Lapply_me = function(X = X, FUN = FUN, Apply_MC =

Re: [R] Change Function based on ifelse() condtion

2018-03-04 Thread Christofer Bogaso
calling FUN, so FUN is being called with zero arguments, exactly as > it is declared. > > A quick workaround is to change the line > > Lapply_me(as.list(1:4), function(xx) { > > to > > Lapply_me(as.list(1:4), function(xx,dummyList) { > > HTH, > Eric > &

[R] Empirical density estimation

2018-03-11 Thread Christofer Bogaso
Hi, Let say I have below vector of data-points : Dat = c(-0.444, -0.25, -0.237449799196787, -0.227467046669042, -0.227454464682363, -0.22, -0.214876033057851, -0.211781206171108, -0.199891067538126, -0.192920353982301, -0.192307692307692, -0.186046511627907, -0.184418145956608, -0.

Re: [R] Empirical density estimation

2018-03-11 Thread Christofer Bogaso
oming along and > sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > On Sun, Mar 11, 2018 at 11:45 AM, Christofer Bogaso > wrote: >> >> Hi, >> >> Let say I have below vector of data-points : >> >>

[R] Rolling window difference for zoo time series

2018-04-24 Thread Christofer Bogaso
Hi, I have a 'zoo' time series as below : Zoo_TS = zoo(5:1, as.Date(Sys.time())+0:4) Now I want to calculate First order difference of order 1, rolling window basis i.e. (Zoo_TS[2] - Zoo_TS[1] ) / Zoo_TS[1] (Zoo_TS[3] - Zoo_TS[2] ) / Zoo_TS[2] . Is there any direct function available to ac

[R] Quandl data download error

2018-05-14 Thread Christofer Bogaso
Hi, I use Quandl package to download data from Quandl https://www.quandl.com Today when I tried to download data from there, I received below error : > Quandl('LME/PR_CO') Error in curl::curl_fetch_memory(url, handle = handle) : gnutls_handshake() failed: An unexpected TLS packet was received

[R] Split a data.frame

2018-05-19 Thread Christofer Bogaso
Hi, I am struggling to split a data.frame as will below scheme : DF = data.frame(name = c('a', 'v', 'c'), val = 0); DF split_str = c('a', 'c') Now, for each element in split_str, R should find which row of DF contains that element, and return DF with all rows starting from next row of the corre

[R] Wired result when I convert from Character to Numeric

2018-05-23 Thread Christofer Bogaso
Hi, Below is my simple result in R > x = "1282553.821000" > as.numeric(x) [1] 1282554 Any idea where all numbers in the decimal places (ie 8, 2, 1) are gone? Thanks, __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://sta

[R] Unable to take correct Web-snapshot

2018-06-01 Thread Christofer Bogaso
Hi again, I use the *webshot* package to take snapshot from Webpage. However, when I try to take snapshot from* https://www.coinbase.com/ *, this fails to take the full snapshot of that page. I tried following : > library(webshot) > webshot("https://www.coinbase.com/";

Re: [R] Unable to take correct Web-snapshot

2018-06-01 Thread Christofer Bogaso
Thanks for that information. However how can I use R to directly get data from that API? On Fri, Jun 1, 2018 at 8:36 PM Martin Møller Skarbiniks Pedersen < traxpla...@gmail.com> wrote: > On 1 June 2018 at 15:08, Christofer Bogaso > wrote: > > Hi again, > > > >

[R] Time and date conversion

2018-06-04 Thread Christofer Bogaso
Hi, I have an automatic data feed and I obtained a Date vector in the following format: > Date [1] "03 Jun 2018 10:01 am CT""01 Jun 2018 22:04:25 pm CT" I now like to convert it to UTC time-zone Is there any easy way to convert them so, particularly since 1st element doesnt have any Second

[R] Efficient manipulation with list object

2018-06-10 Thread Christofer Bogaso
Hi, I have a list of length 10,000, and each element of that list is a matrix with 3 columns and 2,000 rows. Now when I tried to make a Matrix object with that list using Reduce('rbind', list), my code is taking a considerable amount of time. Is there any way to implement same above task in more

Re: [R] Efficient manipulation with list object

2018-06-10 Thread Christofer Bogaso
s, > > Rui Barradas > > > > Enviado a partir do meu smartphone Samsung Galaxy. > ---- Mensagem original > De: Christofer Bogaso > Data: 10/06/2018 16:33 (GMT+00:00) > Para: r-help > Assunto: [R] Efficient manipulation with list object > > Hi, &

[R] Correctly executing system code using R in Ubuntu server

2018-06-25 Thread Christofer Bogaso
Hi, I am curious on how to correctly run System code with R under Ubuntu. I tried to execute below 2 lines of code using system() functions in Ubuntu server, however could not achieve the desired result. system('Xvfb :10 -ac &') system('export DISPLAY=:10') System parameters: > Sys.info()

Re: [R] Correctly executing system code using R in Ubuntu server

2018-06-25 Thread Christofer Bogaso
LAY=":10") > > x11() > Warning message: > In x11() : cairo-based types may only work correctly on TrueColor visuals > > > > Bill Dunlap > TIBCO Software > wdunlap tibco.com > > On Mon, Jun 25, 2018 at 2:04 PM, Christofer Bogaso < > bogaso.christo..

[R] A question on Statistics

2018-06-30 Thread Christofer Bogaso
Hi, I have a quick question on Statistical distribution as follows, hoping Statisticians here would give me very insightful feedback. Say, I have a large sample from a highly asymmetric distribution ranging from -Inf to +Inf. Now I wish to calculate sample X1 and X2 within which middle 70% probab

Re: [R] A question on Statistics

2018-07-01 Thread Christofer Bogaso
Hi, I could post in StackExchange for sure, however I dont think R-help posting guide discourage asking a question about Statistics, atleast formally. I could further clarify if my question is not elaborate enough. And many apologies if it is very trivial - however still I am looking for 2nd opin

Re: [R] A question on Statistics

2018-07-01 Thread Christofer Bogaso
k you may need to reconsider Jeff's advice. > > > Cheers, > Bert > > > > Bert Gunter > > "The trouble with having an open mind is that people keep coming along and > sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County"

Re: [R] parallel processing in r...

2018-07-01 Thread Christofer Bogaso
Hi, On ' how to use "top" inside the R prompt? ' you can use system('top') command. Thanks, On Sun, Jul 1, 2018 at 9:53 PM Benoit Vaillant wrote: > Hello, > > On Sun, Jul 01, 2018 at 11:31:29AM +, akshay kulkarni wrote: > > I tried "top" at the bash prompt, but it provides a way to measure

[R] R couldnt recognize US Pasific timezome

2018-07-09 Thread Christofer Bogaso
Hi, I wanted to convert Epoch time to readable time with US Pacific Time Zone using 'anytime' package, as below: > library(anytime) > anytime(1417411980, tz = 'PST') [1] "2014-12-01 05:33:00 GMT" Warning message: In as.POSIXlt.POSIXct(x, tz) : unknown timezone 'PST' However it appears that R co

[R] Zoo changing time-zone when I merge 2 zoo time series

2018-07-09 Thread Christofer Bogaso
Hi, Below is my code : library(zoo) Dat1 = structure(c(17890, 17770.01, 17600, 17593, 17630.01), index = structure(c(1512664740, 1512664800, 1512664860, 1512664920, 1512664980), class = c("POSIXct", "POSIXt"), tzone = "America/Los_Angeles"), class = "zoo") Dat2 = structure(c(15804.28, 15720.61, 1

Re: [R] Zoo changing time-zone when I merge 2 zoo time series

2018-07-09 Thread Christofer Bogaso
My default is set as GMT. On Mon, Jul 9, 2018 at 4:01 PM David Wolfskill wrote: > On Mon, Jul 09, 2018 at 03:52:02PM +0530, Christofer Bogaso wrote: > > Hi, > > > > Below is my code : > > > > library(zoo) > > Dat1 = structure(c(17890, 17770.01, 17600, 17

[R] Stop a loop if it takes long time

2018-07-24 Thread Christofer Bogaso
Hi, Let say I am implementing a loop using for() / apply()-family etc. Now, the calculation-time within a particular loop is not fixed, means, some loop takes a long time to finish calculation, and next loop perhaps very quick to finish. I am exploring if there is any way, to check if the calcul

[R] Could not load Package 'rgl'

2017-04-12 Thread Christofer Bogaso
Hi again, I could not load the 'rgl' package with below Error details : > library(rgl) Error : .onLoad failed in loadNamespace() for 'rgl', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.3/Resources/library

[R] Quantmod cant download data

2017-04-18 Thread Christofer Bogaso
Hi again, I generally use Quantmod package to download stock data. However recently I observed that it is unable to download the data although Source file is available. Below is Error I found when I use Quantmod : > library(quantmod) > getSymbols("^NSEI") Error in download.file(paste(yahoo.URL,

[R] How to download the Shiny tutorial video

2017-04-29 Thread Christofer Bogaso
Hi again, I was trying to learn Shiny from Shiny tutorial "Teach yourself Shiny" available in https://shiny.rstudio.com/tutorial/. I intend to download this entire video for offline use, however could not find any option available to doing so. I use slow internet connection, therefore it is usefu

[R] Drawing World map divided into 6 economic regions

2017-05-12 Thread Christofer Bogaso
Hi again, I am trying to draw a World map which is divided into 6 Economic regions as available in below link http://www.worldbank.org/en/about/annual-report/regions I am aware of various R ways to draw World map based on Countries like one available in http://stackoverflow.com/questions/241368

[R] How to calculate Rolling mean for a List object

2017-05-14 Thread Christofer Bogaso
Hi again, I am looking to find a way on how to calculate Rolling average for the elements of a list. For example consider below object 'Data'. This is a list, where each elements are a Matrix. Basically, I am trying to get Rolling average of those Matrices with rolling window as 5. Data = structu

[R] Matching values between 2 data.frame.

2017-05-20 Thread Christofer Bogaso
Hi again, Let say I have below 2 data frames. OriginalData = data.frame('Value1' = 1:12, 'Value2' = 11:22, 'AA1' = c('AA4', 'AA3', 'AA4', 'AA1', 'AA2', 'AA1', 'AA6', 'AA6', 'AA3', 'AA3', 'AA4', 'AA3'), 'Value' = NA) TargetValue = data.frame('AA' = c('AA1', 'AA2', 'AA3', 'AA4', 'AA5', 'AA6'), 'BB

[R] Creating/Reading a complex string in R

2017-07-18 Thread Christofer Bogaso
Hi again, Let say I have below string (arbitrary)

Re: [R] Creating/Reading a complex string in R

2017-07-18 Thread Christofer Bogaso
Thanks for your pointer. Is there any way in R how to replace " ' " with " /' " programmatically? My actual string is quite lengthy, so changing it manually may not be possible. I am aware of gsub() function, however not sure I can apply it directly on my original string. Regards, On Tue, Jul 1

[R] Extracting numeric part from a string

2017-08-02 Thread Christofer Bogaso
Hi again, I am struggling to extract the number part from below string : "\"cm_ffm\":\"563.77\"" Basically, I need to extract 563.77 from above. The underlying number can be a whole number, and there could be comma separator as well. So far I tried below : > library(stringr) > str_extract("\"

[R] Strange behaviour to download zip file using R

2017-08-03 Thread Christofer Bogaso
Hi again, I was trying to download stock market data from below link : https://www.nseindia.com/products/content/equities/equities/archieve_eq.htm Input choice : Select Report: Bhavcopy Date(DD-MM-): 03-03-2010 If you put manual input as above, then we will get option for manual download o

[R] Zoo rolling window with increasing window size

2017-08-10 Thread Christofer Bogaso
Hi again, I am wondering there is any function for 'zoo' time series, where I can apply a user defined function rolling window basis, wherein window size is ever increasing i.e. not fixed. For example, let say I have below user defined function and a zoo time series : > library(zoo) > UDF = func

Re: [R] Zoo rolling window with increasing window size

2017-08-10 Thread Christofer Bogaso
t; R> identical(rs, cs) > [1] TRUE > > > On Thu, Aug 10, 2017 at 1:28 PM, Christofer Bogaso > wrote: >> Hi again, >> >> I am wondering there is any function for 'zoo' time series, where I >> can apply a user defined function rolling window basis,

Re: [R] Zoo rolling window with increasing window size

2017-08-10 Thread Christofer Bogaso
> > r <- rollapplyr(x, seq_along(x), yourCustomFunctionGoesHere) > > On Thu, Aug 10, 2017 at 1:39 PM, Christofer Bogaso > wrote: >> Hi Joshua, thanks for your prompt reply. However as I said, sum() >> function I used here just for demonstrating the problem, I have othe

[R] Getting all possible combinations

2017-08-23 Thread Christofer Bogaso
Hi again, I am exploring if R can help me to get all possible combinations of members in a group. Let say I have a group with 5 members : A, B, C, D, E Now I want to generate all possible unique combinations with all possible lengths from that group e.g. 1st combination : A 2nd combination : B

[R] load() failed to load .Rdata file in AWS-Ububtu

2017-10-07 Thread Christofer Bogaso
Hi again, I hope this is the right place to post my question on running R within Ubuntu, however if not, any pointer on right distribution list will be helpful. I am currently using R in Ubuntu which is hosted in Amazon - AWS. I have a .Rdata file in AWS which I am trying to load in R. Used foll

Re: [R] load() failed to load .Rdata file in AWS-Ububtu

2017-10-08 Thread Christofer Bogaso
try the following >> sudo cp /srv/shiny-server/Dat.Rdata . (if you have sudo privileges - only >> do this if the former command did not work) >> chmod 777 Dat.Rdata (a bit of overkill - again preface by sudo if it does >> not work without it) > > Then in your R sessi

Re: [R] load() failed to load .Rdata file in AWS-Ububtu

2017-10-09 Thread Christofer Bogaso
unning on AWS and see if following the steps helps you > discover the problem. > > Good luck, > Eric > > > > > On Sun, Oct 8, 2017 at 8:05 PM, Christofer Bogaso > wrote: >> >> Thanks Eric for your pointer. However I just altered the argument of >&

[R] Downloading attachment from gmail

2016-05-24 Thread Christofer Bogaso
Hi folks, I am wondering if it is really possible via some R code which shall do the following 1. Login to a Gmail account (account name and password will be provided to R) 2. Search for all mails which has a word "ABCD" in the mail body 3. Download all the attachments (if available) which will h

[R] String match

2016-06-04 Thread Christofer Bogaso
Hi again, I am facing trouble to match a vector strings. Let say I have below full string vector WhereToLook = c("ultracemco.bo.openam" , "ultracemco.bo.higham" ,"ultracemco.bo.lowam" , "ultracemco.bo.closeam" , "ultracemco.bo.volumeam" ,"ultracemco.bo.adjustedam") WhatToLook = c("vol

[R] Writing data onto xlsx file without cell formatting

2016-07-10 Thread Christofer Bogaso
Hi again, I am trying to write a data frame to an existing Excel file (xlsx) from row 5 and column 6 of the 1st Sheet. I was going through a previous instruction which is available here : http://stackoverflow.com/questions/32632137/using-write-xlsx-in-r-how-to-write-in-a-specific-row-or-column-in

[R] Please assist me to download this data

2016-07-25 Thread Christofer Bogaso
Hi again, I am trying to find some way to download all data historically from this website "https://www.amfiindia.com/net-asset-value/nav-history";. Basically what I am trying to do is, I shall have a range of dates and for each date I need to download entire dataset programmatically. Really app

Re: [R] Please assist me to download this data

2016-07-25 Thread Christofer Bogaso
ot the easiest format to get into R, and you might have to > pre-process it. > > Best, > Ulrik > > On Mon, 25 Jul 2016 at 20:37 Christofer Bogaso > wrote: >> >> Hi again, >> >> I am trying to find some way to download all data historically fr

Re: [R] Please assist me to download this data

2016-07-25 Thread Christofer Bogaso
he website - >> you simply filter the data by your dates. >> >> I think that's the easiest solution. >> >> Best wishes, >> Ulrik >> >> Christofer Bogaso schrieb am Mo., 25. Juli >> 2016 21:30: >> >>> Hi Ulrik, Thanks for your

[R] A question on data frame

2016-08-24 Thread Christofer Bogaso
Hello again, Let say I have a data.frame which I call as reference data frame : Ref = data.frame(c("a", "d", "c", "e", "f", "x"), matrix(NA, 6, 5)) colnames(Ref) = c("a1", "a2", "a3", "a4", "a5", "a6") Ref Now I have another data.frame, which I call as value data frame : Value = data.frame(c("x

[R] Error in reading subset of data from CSV file

2016-09-04 Thread Christofer Bogaso
Hi again, I was trying to read a subset of Data from a CSV file using below code as example : library(sqldf) Dat = structure(list(`col 1` = c(133261L, 133261L, 133262L, 133262L ), `col 2` = structure(1:4, .Label = c("aaa1", "aaa2", "bbb1, bbb", "bbb3, bbb"), class = "factor"), `col 3` = c(10.59,

Re: [R] Error in reading subset of data from CSV file

2016-09-04 Thread Christofer Bogaso
; On Sun, Sep 4, 2016 at 5:54 PM, Christofer Bogaso > wrote: >> Hi again, >> >> I was trying to read a subset of Data from a CSV file using below code >> as example : >> >> library(sqldf) >> >> Dat = structure(list(`col 1` = c(133261L, 133261

Re: [R] Error in reading subset of data from CSV file

2016-09-04 Thread Christofer Bogaso
Didnt work getting unused argument error. On Sun, Sep 4, 2016 at 4:47 PM, Jim Lemon wrote: > I suppose you could try quote=TRUE > > Jim > > > On Sun, Sep 4, 2016 at 8:13 PM, Christofer Bogaso > wrote: >> Thanks Jim. But my data is like that and I have to liv

Re: [R] Writing data onto xlsx file without cell formatting

2016-09-26 Thread Christofer Bogaso
Mon, Jul 11, 2016 at 10:43 AM, Ismail SEZEN wrote: > I think, this is what you are looking for: > > http://stackoverflow.com/questions/11228942/write-from-r-into-template-in-excel-while-preserving-formatting > > On 11 Jul 2016, at 03:43, Christofer Bogaso > wrote: > > Hi aga

Re: [R] Writing data onto xlsx file without cell formatting

2016-09-26 Thread Christofer Bogaso
; > > Jim Holtman > Data Munger Guru > > What is the problem that you are trying to solve? > Tell me what you want to do, not how you want to do it. > > On Mon, Sep 26, 2016 at 5:56 PM, Christofer Bogaso > wrote: >> >> Hi again, >> >> I have been fo

Re: [R] Writing data onto xlsx file without cell formatting

2016-09-27 Thread Christofer Bogaso
do not want. What could be right code for doing so? Thanks and regards, PS: not very sure if R forum would accept my attachment, if not that file is available in https://ufile.io/50944 On Tue, Sep 27, 2016 at 12:06 PM, Daniel Nordlund wrote: > On 9/26/2016 2:56 PM, Christofer Bogaso wrot

[R] Folder size

2015-03-01 Thread Christofer Bogaso
Hi again, I am wondering if there is any way to extract the Folder size. For example, I want to get information of size for all folders in my C: drive. It seems that the function file.info() only work for File, not on Folder. Appreciate any pointer. Thanks and regards,

[R] Saving objects in RData file in different name

2018-07-28 Thread Christofer Bogaso
Hi, Let say I have 2 objects as below x1 = 1:3 x2 = 5:4 Now I want to save both x1 and x2 in some RData file, however x1 will be saved with a different name e.g. y I tried below save(y = x1, x2, file = "file.RData") However still they are saved in their original names i.e. x1 and x2, not y an

[R] dbGetQuery() returns wrong value

2018-07-30 Thread Christofer Bogaso
Hi, I used following SQL query to fetch information from DB > dbGetQuery(Conn, "select ID from where date = '2018-07-18' and ID = '72075186224672770' limit 10") ID 1 72075186224672768 As you see, it is returning a different result from what actual query string contains. However wh

Re: [R] dbGetQuery() returns wrong value

2018-07-30 Thread Christofer Bogaso
0.0 loaded via a namespace (and not attached): [1] compiler_3.5.0 tools_3.5.0 On Mon, Jul 30, 2018 at 2:27 PM Christofer Bogaso < bogaso.christo...@gmail.com> wrote: > Hi, > > I used following SQL query to fetch information from DB > > > dbGetQuery(Conn, "select ID from XX

Re: [R] dbGetQuery() returns wrong value

2018-07-30 Thread Christofer Bogaso
The data type is defined as bigint On Mon, Jul 30, 2018 at 4:45 PM Eric Berger wrote: > The ID matches in the first 16 characters. > How is your table declared? > > > On Mon, Jul 30, 2018 at 2:00 PM, Christofer Bogaso < > bogaso.christo...@gmail.com> wrote: >

[R] Adding % sign to ticks in persp()

2018-08-05 Thread Christofer Bogaso
Hi, Is there any way to add styles to the tick marks in persp() function? For eample I want to add '%' suffix to the z-axis tick marks.in below plot : x <- seq(-10, 10, length= 30) y <- x f <- function(x, y) { r <- sqrt(x^2+y^2); 10 * sin(r)/r } z <- outer(x, y, f) z[is.na(z)] <- 1 op <- par(bg

Re: [R] [FORGED] Adding % sign to ticks in persp()

2018-08-05 Thread Christofer Bogaso
LSE) > } > lapply(labelGrobs, addPercent) > grid.refresh() > > ... is that what you meant? The positioning of the labels relative to > the tick marks is imperfect and could perhaps be improved by also > editing the 'cex' for the labels, but hopefully this gets close enough

[R] Cant schedule R job using taskscheduleR

2018-08-24 Thread Christofer Bogaso
Hi, I am trying to schedule an R job using taskscheduler_create() function available in package taskscheduleR. Below is my code: > library(taskscheduleR) Warning message: package ‘taskscheduleR’ was built under R version 3.5.1 > taskscheduler_create(taskname = "ABC", rscript = paste("C:\\ABC.R")

[R] Obtaining exact pattern in list.files()

2018-09-12 Thread Christofer Bogaso
Hi, In the list.files() function, there is an argument 'pattern' to locate the desired files. However I failed to see if I can manage to fetch those files that having an exact match. For example, if there are 2 files that contain the expression 'File' and 'Second_File', then I should get the 1st

[R] How to remove backslash

2018-09-21 Thread Christofer Bogaso
Hi, I have below string where I am trying to remove Backslash from. I tried with gsub() function, however failed to remove that: > str = ' gsub("\\", "", str) Error in gsub("\\", "", str) : invalid regular expression '\', reason 'Trailing backslash' Any pointer to the right approach? Thanks

[R] Drawing a random number

2018-11-29 Thread Christofer Bogaso
Hi, I would like to draw an Integer from a range of [10, 1000] inclusive, however that random integer should be outside of a pre-defined vector of integers. Let say I draw an integer as below as.integer(runif(1, 10, 1000)) and my pre-defined vector is Vec = c(563, 453, 897, 567) The policy is

[R] POSIXct format

2018-12-04 Thread Christofer Bogaso
Hi, I am trying to format my Character strings to POSIXct as below : > as.POSIXct('2018-11-2700:00:00', format = "%Y-%m-%d%H:%M:%S", tz = 'UTC') [1] "2018-11-27 UTC" > as.POSIXct('2018-11-2701:00:00', format = "%Y-%m-%d%H:%M:%S", tz = 'UTC') [1] "2018-11-27 01:00:00 UTC" For the first case, I wa

[R] Width of a text

2018-12-12 Thread Christofer Bogaso
Hi, In HTML there is a way to measure the width of a Text before printing it on screen as in https://www.w3schools.com/tags/canvas_measuretext.asp In R we have nchar() function which just measures the number of letters in a Text, but I wonder if we can measure the width of text as well. I have a

[R] Webshot failed to take snapshot in Ubuntu machine

2018-12-18 Thread Christofer Bogaso
Hi, I was using webshot package to take snapshot of a webpage as below: library(webshot) webshot(' https://www.bseindia.com/stock-share-price/asian-paints-ltd/asianpaint/500820/', 'bb.pdf') However what I see is a Blank PDF file is saved. However if I use the same code in my windows machine it

Re: [R] Webshot failed to take snapshot in Ubuntu machine

2018-12-18 Thread Christofer Bogaso
1.5 pillar_1.3.0 [9] rlang_0.2.2 debugme_1.1.0callr_3.0.0 tools_3.4.4 [13] compiler_3.4.4 processx_3.2.0 base64enc_0.1-3 tibble_1.4.2 On Tue, Dec 18, 2018 at 6:07 PM Christofer Bogaso < bogaso.christo...@gmail.com> wrote: > Hi, > > I was using webshot package to take sna

Re: [R] Webshot failed to take snapshot in Ubuntu machine

2018-12-18 Thread Christofer Bogaso
nodename > "lepidochelys" >machine > "x86_64" > > Not sure what to do... > > Marc > > Le 18/12/2018 à 13:37, Christofer Bogaso a écrit : >

[R] Failed to install RQuantLib in Ubuntu machine

2019-01-02 Thread Christofer Bogaso
Hi, I was trying to install RQuantLib in my Ubuntu machine which failed with below information : *> install.packages('RQuantLib', INSTALL_opts = c('--no-lock'))* *Installing package into ‘/usr/local/lib/R/site-library’* *(as ‘lib’ is unspecified)* *trying URL 'https://cloud.r-project.org/src/c

Re: [R] Webshot failed to take snapshot in Ubuntu machine

2019-01-06 Thread Christofer Bogaso
version of 'phantomjs' on your > computer, i.e., the one that webshot() will then try to use and > somehow fails. > > I'd recommend you run webshot::install_phantomjs() > which then should install a "better" version of the 'phantomjs' > executabl

[R] TIme Zone error

2019-01-26 Thread Christofer Bogaso
Hi, I want to set a specific Timezone for my R environment, with below syntax: > Sys.getenv("Asia/Calcutta") [1] "" > But it sets to some blank timezone. I checked with OlsonNames(), to see available zones for R, where I found "Asia/Calcutta" available. I idea why R failed to set timezone pro

[R] Memory usage

2019-02-18 Thread Christofer Bogaso
Hi, I have below lines of code to understand how R manages memory. > library(pryr) *Warning message:* *package ‘pryr’ was built under R version 3.4.3 * > mem_change(x <- 1:1e6) 4.01 MB > mem_change(y <- x) 976 B > mem_change(x[100] < NA) 976 B > mem_change(rm(x)) 864 B > mem_change(rm(

[R] Complete month name from as.yearmon()

2019-04-13 Thread Christofer Bogaso
Hi, I am wondering if there is any way to get the full name from as.yearmon() function. Please consider below example: library(quantmod) as.yearmon(Sys.Date()) This gives: [1] "Apr 2019". How can I extract the full name ie. 'April 2019' Appreciate your pointer. Thanks, [[alternative H

[R] Snapshot of a shiny app

2019-04-16 Thread Christofer Bogaso
Hi, I have a Shiny app with address like http://xx.xx.xx.xx:1080/remotepp/ When I try to get a PDF snapshot of this app using webshot() function from webshot package, I see a blank PDF file saved. I also tried with appshot() function as below, however getting error: appshot(" http://xx.xx.xx.xx

[R] Working with the Animation package in R

2014-07-31 Thread Christofer Bogaso
Hi again, I am trying to create a animation with Animation package. I preferred to create animation with HTML file than through GIF because this requires additional installation of ImageMagick which is not possible with my system. So I just run following code available in help page: saveHTML({

[R] Working with data-frame

2014-11-09 Thread Christofer Bogaso
Hi again, Let say, I have following data frame: Dat <- structure(list(A1 = structure(c(3L, 3L, 1L, 3L, 3L, 3L, 3L, 2L, 3L, 3L, 1L, 2L, 3L, 2L, 1L, 1L, 3L, 3L, 2L, 3L, 2L, 2L, 3L, 3L, 3L, 2L, 3L, 1L, 1L, 3L), .Label = c("a", "b", "c"), class = "factor"), A2 = c(2, 3, 2, 1, 3, 3, 2, 2, 3, 1, 3

[R] How to download this data

2015-08-25 Thread Christofer Bogaso
Hi, I would like to download data from below page directly onto R. http://www.nseindia.com/live_market/dynaContent/live_watch/equities_stock_watch.htm Could you please assist me how can I do that programmatically. Thanks for your time. __ R-help@r-pr

[R] R editor for Mac

2016-01-20 Thread Christofer Bogaso
Hi, Could you please suggest a good R editor for Mac OS X (10.7.5) Previously my operating system was Windows and there I used Notepad++, I really had very nice experience with it. However I dont see any Mac version is available for Mac. Appreciate your positive feedback. Thanks and regards, __

[R] Downloading Google finance data onto R

2016-01-26 Thread Christofer Bogaso
Hi dear, I was trying to download a Google TS data directly onto R from this link : https://www.google.com/finance?q=NSE%3ALIQUIDBEES&ei=xlGnVuiPJ9eDuQSZ05OICw Used following function, however R generates error. > library(quantmod) > getSymbols(Symbols = "LIQUIDBEES", src = "google") Error in d

[R] How to delete Locked files in Mac

2016-04-16 Thread Christofer Bogaso
Hi, I am looking for some R code, which will delete all files in a Folder that contains both Locked and Unlocked files. There are many, therefore i would like to delete all files programmatically in one go. I used following code : ## "SS" is the Folder name including entire path which contains L

Re: [R] How to delete Locked files in Mac

2016-04-16 Thread Christofer Bogaso
gt; > > > On Apr 16, 2016, at 3:09 PM, Christofer Bogaso > wrote: > >> Hi, >> >> I am looking for some R code, which will delete all files in a Folder >> that contains both Locked and Unlocked files. There are many, >> therefore i would like to delete al

[R] gsub() could not replace my string

2016-10-07 Thread Christofer Bogaso
Hello again, I have few many string elements, and some of those elements contain a special phrase as '"[NA]NA%", which I planned to replace by some Blank. So I tried with below code in R > gsub("[NA]NA%", "", "[NA]NA%abcde") [1] "[NA]NA%abcde" It appears that, my code could not replace "[NA]NA%"

[R] How to put below code in Automator in iOS

2016-10-27 Thread Christofer Bogaso
Hi, I have a piece of code available here http://mcu.edu.tw/~chenmh/teaching/project/r/reference/RTclTkExamples/radiobuttons.html Now I put that code in a .R file and then created an .app file in Mac using Automator as explained below https://www.r-bloggers.com/how-to-source-an-r-script-automat

[R] Download data from Internet contained in a Zip file

2016-12-25 Thread Christofer Bogaso
Hi again, I was following the instruction available in "http://stackoverflow.com/questions/3053833/using-r-to-download-zipped-data-file-extract-and-import-data"; to download data from Internet contained in a zip file from the address : https://npscra.nsdl.co.in/download.php?path=download/&filenam

Re: [R] Download data from Internet contained in a Zip file

2016-12-25 Thread Christofer Bogaso
d all the solutions I have seen > involve knowing what operating system you are using. I highly recommend that > you study what Google has to say when you include that detail and leave out > the zip keyword. > -- > Sent from my phone. Please excuse my brevity. > > On Decem

[R] A VaR question

2009-11-12 Thread Christofer Bogaso
Hi, I got some problem to drop a mail while using Nabble account, therefore sending it again there. My query is following : Hi all, My question is not directly R related but rather a finance related question. Therefore I was wondering wheher I find a reliable answer here. Here I wanted to calcu

[R] Cumulative probability from binomial distribution

2022-06-30 Thread Christofer Bogaso
Hi, I have the below output. > pbinom(0.10, 1, 0.40) [1] 0.6 I am curious what it means to serve a fraction as the first argument in pbinom()? Thanks for your time __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.eth

[R] Fixing the size of R's Graphic Device

2022-08-25 Thread Christofer Bogaso
Hi, I am wondering if there is any way to fix the size (i.e. height and width) of R's graphic device permanently. Every time I open R, and create my first plot, the default size of the graphic device is fairly small, and I need to adjust it manually to make it of comfortable size. Any help is rea

Re: [R] Fixing the size of R's Graphic Device

2022-08-25 Thread Christofer Bogaso
device? That is, what OS are you using? > > On August 25, 2022 11:10:45 AM PDT, Christofer Bogaso > wrote: > >Hi, > > > >I am wondering if there is any way to fix the size (i.e. height and > >width) of R's graphic device permanently. Every time I open R, and >

Re: [R] Fixing the size of R's Graphic Device

2022-08-25 Thread Christofer Bogaso
ypos=100)) > graphics.off() > plot(1:10) > > > -Bill > > > On Thu, Aug 25, 2022 at 11:11 AM Christofer Bogaso > wrote: >> >> Hi, >> >> I am wondering if there is any way to fix the size (i.e. height and >> width) of R's graphic device permane

Re: [R] Fixing the size of R's Graphic Device

2022-08-25 Thread Christofer Bogaso
y have a 300 > inch display? > > On August 25, 2022 12:05:00 PM PDT, Christofer Bogaso > wrote: > >Thanks. > > > >But this is woking upto some number > > > >For example > > > >options(device=function()windows(width=303,height=354,xpos=-5

[R] How to access source code

2022-12-08 Thread Christofer Bogaso
Hi, I am trying to access the source code from package GCPM, where I am interested to look into the source code of one function called LGD. So I did below > LGD standardGeneric for "LGD" defined from package "GCPM" function (this) standardGeneric("LGD") Methods may be defined for argumen

  1   2   3   >