Displaying 13 results from an estimated 13 matches for "str_pad".
Did you mean:
st_pad1
2018 Mar 05
4
raster time series statistics
Hi List,
The following code returns an "Error in as.POSIXlt.character(x, tz, ...) : character string is not in a standard unambiguous format"
require(raster)
require(rts)
require(stringi)
r <- raster(ncol=100, nrow=100)
values(r) <- runif(ncell(r))
list(ID=seq(1:24),month=rep(str_pad(1:12, pad = 0,width = 2 , "left"),2),year=sort(rep(2016:2017,12)))->dt
stack(r)->s
r->rs
for(i in 1:23){
rs[]<-r[]*i
addLayer(s,rs)->s
print(nlayers(s))
}
timelst<-paste0(unlist(dt['year']),'-',unlist(dt['month']))
rts(s,time=as.yearmon(timelst)...
2018 Mar 06
0
raster time series statistics
...n a standard unambiguous format"
I'm unable to produce that error. Which function was being evaluated to produce the error? I don't see where as.POSIXlt would have been called. You don't have any Date or POSIXt-classed variables. (I did need to also load the stringr package to get str_pad into my workspace.)
>
> require(raster)
> require(rts)
> require(stringi)
> r <- raster(ncol=100, nrow=100)
> values(r) <- runif(ncell(r))
> list(ID=seq(1:24),month=rep(str_pad(1:12, pad = 0,width = 2 , "left"),2),year=sort(rep(2016:2017,12)))->dt
> stac...
2012 Jun 27
2
A solution for question about formatting Dates
...x) {
#Note: x is a data frame
#Assume that Column 1 has the date
#Column 2 has station
#Column 3 has min
#Column 4 has max
library(stringr)
w <- character(length=nrow(x))
z <- str_split(x[,1],"/")
for(i in 1:nrow(x)) {
u <- str_pad(z[[i]][1:3],width=2,pad="0")
w[i] <- paste(u,sep="",collapse="/")
}
a <- as.Date(w,"%m/%d/%Y")
This is not particularly elegant, but it does the trick.
Thanks,
Erin
--
Erin Hodgess
Associate Professor
Department of Computer and Math...
2013 Mar 14
3
Working with string
Hello again,
Let say I have following string:
Vec <- c("sada", "asdsa", "sa")
Now I want to make each element of this vector with equal length.
Basically I want following vector:
c("sada ", "asdsa", "sa ")
Therefore we can get:
> nchar(c("sada ", "asdsa", "sa "))
[1] 5 5 5
Is there any
2018 Mar 06
2
raster time series statistics
...n a standard unambiguous format"
I'm unable to produce that error. Which function was being evaluated to produce the error? I don't see where as.POSIXlt would have been called. You don't have any Date or POSIXt-classed variables. (I did need to also load the stringr package to get str_pad into my workspace.)
>
> require(raster)
> require(rts)
> require(stringi)
> r <- raster(ncol=100, nrow=100)
> values(r) <- runif(ncell(r))
> list(ID=seq(1:24),month=rep(str_pad(1:12, pad = 0,width = 2 ,
> "left"),2),year=sort(rep(2016:2017,12)))->dt
>...
2010 Aug 25
0
stringr: version 0.4
...ce function added.
This makes str_replace consistent with all functions.
* new str_sub<- function (analogous to substring<-) for substring replacement
* str_sub now understands negative positions as a position from the end of
the string. -1 replaces Inf as indicator for string end.
* str_pad side argument can be left, right, or both (instead of center)
* str_trim gains side argument to better match str_pad
* stringr now has a namespace and imports plyr (rather than requiring it)
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http:/...
2010 Aug 25
0
stringr: version 0.4
...ce function added.
This makes str_replace consistent with all functions.
* new str_sub<- function (analogous to substring<-) for substring replacement
* str_sub now understands negative positions as a position from the end of
the string. -1 replaces Inf as indicator for string end.
* str_pad side argument can be left, right, or both (instead of center)
* str_trim gains side argument to better match str_pad
* stringr now has a namespace and imports plyr (rather than requiring it)
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http:/...
2018 Mar 06
0
raster time series statistics
...ard unambiguous format"
>
> I'm unable to produce that error. Which function was being evaluated to produce the error? I don't see where as.POSIXlt would have been called. You don't have any Date or POSIXt-classed variables. (I did need to also load the stringr package to get str_pad into my workspace.)
>
>>
>> require(raster)
>> require(rts)
>> require(stringi)
>> r <- raster(ncol=100, nrow=100)
>> values(r) <- runif(ncell(r))
>> list(ID=seq(1:24),month=rep(str_pad(1:12, pad = 0,width = 2 ,
>> "left"),2),year=s...
2018 Mar 06
0
raster time series statistics
...turns an "Error in as.POSIXlt.character(x, tz, ...) : character string is not in a standard unambiguous format"
>
> require(raster)
> require(rts)
> require(stringi)
> r <- raster(ncol=100, nrow=100)
> values(r) <- runif(ncell(r))
> list(ID=seq(1:24),month=rep(str_pad(1:12, pad = 0,width = 2 , "left"),2),year=sort(rep(2016:2017,12)))->dt
> stack(r)->s
> r->rs
> for(i in 1:23){
> rs[]<-r[]*i
> addLayer(s,rs)->s
> print(nlayers(s))
> }
> timelst<-paste0(unlist(dt['year']),'-',unlist(dt['mont...
2011 Jul 01
0
stringr 0.5
...enient
format
* new `word` function extract words from a string given user defined
separator (thanks to suggestion by David Cooper)
* `str_locate` now returns consistent type when matching empty string (thanks
to Stavros Macrakis)
* new `str_count` counts number of matches in a string.
* `str_pad` and `str_trim` receive performance tweaks - for large vectors this
should give at least a two order of magnitude speed up
* str_length returns NA for invalid multibyte strings
* fix small bug in internal `recyclable` function
--
Assistant Professor / Dobelman Family Junior Chair
Department...
2011 Jul 01
0
stringr 0.5
...enient
format
* new `word` function extract words from a string given user defined
separator (thanks to suggestion by David Cooper)
* `str_locate` now returns consistent type when matching empty string (thanks
to Stavros Macrakis)
* new `str_count` counts number of matches in a string.
* `str_pad` and `str_trim` receive performance tweaks - for large vectors this
should give at least a two order of magnitude speed up
* str_length returns NA for invalid multibyte strings
* fix small bug in internal `recyclable` function
--
Assistant Professor / Dobelman Family Junior Chair
Department...
2003 Oct 08
4
OS/390 openssh
...);
+}
+#endif
diff -bur openssh-3.7.1p2.orig/auth-passwd.c openssh-3.7.1p2/auth-passwd.c
--- openssh-3.7.1p2.orig/auth-passwd.c Thu Sep 18 10:26:48 2003
+++ openssh-3.7.1p2/auth-passwd.c Tue Oct 7 08:21:59 2003
@@ -50,6 +50,18 @@
extern ServerOptions options;
+#if #system(bs2000)
+static void str_pad(char *dest, size_t size, char ch)
+{
+ int i = strlen(dest); /* Leave space for trailing '\0' */
+
+ while (i < size-1)
+ dest[i++] = ch;
+
+ dest[size-1] = '\0'; /* Guarantee for trailing '\0' */
+}
+#endif /*system(bs2000)*/
+
/*
* Tries to authenticate...
2019 Aug 04
6
gfortran 9 quantreg bug
I?d like to solicit some advice on a debugging problem I have in the quantreg package.
Kurt and Brian have reported to me that on Debian machines with gfortran 9
library(quantreg)
f = summary(rq(foodexp ~ income, data = engel, tau = 1:4/5))
plot(f)
fails because summary() produces bogus estimates of the coefficient bounds.
This example has been around in my R package from the earliest days of R,