Hi, all How to format and join strings ? For example, like following short python examples. ********* name1 = 'sample-plot' filename = '%s.png' % name1 inputdir = '/path/to/dir' os.path.join(inputdir, filename) ********** Best, Hyunchul Kim [[alternative HTML version deleted]]
Try this: name1 <- 'sample-plot' filename <- sprintf("%s.png", name1) inputdir <- '/path/to/dir' paste(inputdir, filename, sep="") On 19/02/2008, Hyunchul Kim <sundol313 at naver.com> wrote:> Hi, all > > How to format and join strings ? > For example, like following short python examples. > > ********* > name1 = 'sample-plot' > filename = '%s.png' % name1 > > inputdir = '/path/to/dir' > os.path.join(inputdir, filename) > > ********** > > Best, > Hyunchul Kim > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Henrique Dallazuanna Curitiba-Paran?-Brasil 25? 25' 40" S 49? 16' 22" O
Hyunchul Kim wrote:> How to format and join strings ? > For example, like following short python examples. > > ********* > name1 = 'sample-plot' > filename = '%s.png' % name1Two options are sprintf() and paste():> name1 = "sample-plot" > sprintf("%s.png", name1)[1] "sample-plot.png"> paste(name1, "png", sep = ".")[1] "sample-plot.png" HTH, Andre
Hello R experts I am just learning how to build a package so this is probably a basic question. I have read the manual( well, to be more truthful, am reading) the manual, and I have searched the archives to the best of my ability. I am on Windows. When running the command "R CMD check packagename" I get this type of error: * checking package dependencies ... ERROR Packages required but not available: chron I think this is because I install my packages in "mylibrary" and use "R_LIBS=C:/PROGRA~1/R/mylibrary" in my Renviron.site file. If I move the package to the R main library it fixes the problem. But rather defeats the intention behind having a separate mylibrary. Can anybody tell me how to solve this? That is keep my installed packages in mylibrary but get the package check/build to work? I guess Depends: has a search path but I cannot find it or how to alter it. Can anybody point me to some documentation? Thanks very much for any help. Regards John Seers> sessionInfo()R version 2.6.2 (2008-02-08) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats graphics grDevices datasets utils methods base other attached packages: [1] chron_2.3-20 limma_2.12.0 RWinEdt_1.7-9>---
I think you need "-l": R CMD check -l <your_library> <your_package> Gabor On Tue, Feb 19, 2008 at 02:00:38PM -0000, john seers (IFR) wrote: [...]> I think this is because I install my packages in "mylibrary" and use > "R_LIBS=C:/PROGRA~1/R/mylibrary" in my Renviron.site file. If I move the > package to the R main library it fixes the problem. But rather defeats > the intention behind having a separate mylibrary. > > Can anybody tell me how to solve this? That is keep my installed > packages in mylibrary but get the package check/build to work? I guess > Depends: has a search path but I cannot find it or how to alter it. Can > anybody point me to some documentation?[...] -- Csardi Gabor <csardi at rmki.kfki.hu> UNIL DGM