ctions with not too much more typing.
>
> On Thu, Oct 20, 2016 at 5:47 PM, Jan Kacaba wrote:
> > Hello dear R-help
> >
> > I tried to find function which returns number of occurrences of a pattern
> > in string. The closest match I've found is str_locate_all in
Hello dear R-help
I tried to find function which returns number of occurrences of a pattern
in string. The closest match I've found is str_locate_all in stringr
package. I can use str_locate_all but write my function but I don't want
reinvent wheel.
JK
[[alternative HTML version deleted]
2016-10-01 18:02 GMT+02:00 David Winsemius :
>
>> On Oct 1, 2016, at 8:44 AM, Jan Kacaba wrote:
>>
>> Hello Dear R-help
>>
>> I tried to understand how recursive programming works in R. Bellow is
>> simple recursive function.
>>
>> binary1 <-
Hello Dear R-help
I tried to understand how recursive programming works in R. Bellow is
simple recursive function.
binary1 <- function(n) {
if(n > 1) {
binary(as.integer(n/2))
}
cat(n %% 2)
}
When I call binary1(10) I get 1010. I believe that cat function stores
value to a buffer appen
Dear R help,
I would like to run script upon saving project files or exiting the R Studio.
For example I would like to backup whole project in another directory.
The backup directory should be named such that incremental version
number will added to project name.
Is it somehow possible? Even bet
Hello dear R-help
I would like to use some short and simple names multiple times inside
one script without collisions. I need to wrap the variables inside
some object. I know I can use class function or environment. For
example as follows:
exmp1<-function(){
# knowns
pa=0.35
pb=0.35
pc=
ends))
> }
>
> Will be much faster than substring (e.g. 100x or 1000x) when
> chopping a string like a Human chromosome into hundreds or
> thousands of fragments.
>
> Biostrings is a Bioconductor package:
>
> https://bioconductor.org/packages/Biostrings
>
t 10:05 AM, Jim Lemon wrote:
>> Hi Jan,
>> This might be helpful:
>>
>> chop_string<-function(x,ends) {
>> starts<-c(1,ends[-length(ends)]-1)
>> return(substring(x,starts,ends))
>> }
>>
>> Jim
>>
>>
>> On Thu,
7; package:
> https://cran.r-project.org/web/packages/stringr/stringr.pdf
>
> 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
Dear R-help
I would like to split long string at specified precomputed positions.
'substring' needs beginings and ends. Is there a native function which
accepts positions so I don't have to count second argument?
For example I have vector of possitions pos<-c(5,10,19). Substring
needs input first
Hello dear R helpers,
Is it possible to have more than 1 row for column names in data.frame,
array, tbl_df? I would like to have column numbers in the first row, string
names in the second row, physical unit in third row.
How would I do it?
Derek
[[alternative HTML version deleted]]
___
Hello dear R users,
Is there a function or package which can insert row, column or array in
another array at specified place (row or column)?
I have made several attempts at this function optimizing both speed, code
readability and ease of use. The functions are of following format:
appcol=funct
Hello dear R, I dont have specific task on mind just learning R.
1) Is it possible to open a document for example path1\myfile.pdf with
program path2\pdfviewer.exe ?
How would I do it in win? Does it differ in linux?
2) Is it possible to run a program and supply to it some streams? The
streams a
eed to write string to a
file.
I hope there is no problem processing strings with other functions like
paste, strsplit, grep though.
Derek
2016-03-30 0:56 GMT+02:00 Duncan Murdoch :
> On 29/03/2016 5:39 PM, Jan Kacaba wrote:
>
>> I have problem with accented characters. My OS is Win 8
I have problem with accented characters. My OS is Win 8.1 and I'm using
RStudio.
I make string :
av="ěščřž"
When I call "av" I get result bellow.
> av
[1] "ìšèøž"
The resulting characters are different. I have similar problem when I write
string to a file. In RGUI if I call "av" it prints charac
Hello, is it possible to run kiniter by script instead by clicking on
button compile PDF?
Say I have "texfile.rnw" and "myscript.R". I would like to knit texfile.rnw
by runnig script "myscript.R".
In "myscript.R" I would write something like this:
knit("texfile.rnw")
[[alternative HTML ve
Hello, I have following problem in loops. It occurred to me multiple times
bellow is an example. Inside if() I have sometimes function f(x) which may
return integer(0). If I test f(x)>1 and f(x)=integer(0) I get error. Maybe
it can be solved more eloquently without loop or swithces. I don't know.
Hello I would like to assign a vector to list sequence. I'm trying my code
bellow, but the output is not what inteded.
# my code
mls=vector(mode="list") # my list
cseq=c(1:3) # my vector
mls[cseq]=cseq
I get following:
[[1]]
[1] 1
[[1]]
[2] 2
[[1]]
[2] 3
What I need is this:
[[1]]
[1] 1 2 3
[[1]
Hello, I'm rather desperate so please excuse me if I'm using wrong emails.
I'm sad that the forum at nabble is not functinal as before. I'm by no way
want to critique something. I just don't understand in which way is mailing
better than forum.
I'm subscriber to R-help, but it seems that I'm unabb
In my original data a csv file I have missing values. If I use read.table
the missing values are replaced by NAs.
Is it possible to get object where missing values aren't replaced with NAs?
Is it possible to replace NAs with empty space?
[[alternative HTML version deleted]]
_
20 matches
Mail list logo