It is not reproducible [1] because I cannot run your (representative) example.
The type of regex pattern, token, and even the character of the data you are
searching can affect possible optimizations. Note that a non-memory-resident
tool such as sed or perl may be an appropriate tool for a
How’s that not reproducible?
1. Data frame, one column with text strings
2. Size of data frame= 4million observations
3. A bunch of gsubs in a row ( gsub(patternvector,
“[token]“,dataframe$text_column) )
4. General question: How to speed up string operations on ‘large' data sets?
Please let
what is missing is any idea of what the 'patterns' are that you are searching
for. Regular expressions are very sensitive to how you specify the pattern.
you indicated that you have up to 500 elements in the pattern, so what does it
look like? alternation and backtracking can be very
Hi experts
How can I read only one column of an excel file using RODBC in r?
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
On 05/11/2013 09:18, Baro wrote:
Hi experts
How can I read only one column of an excel file using RODBC in r?
The same way as for any other ODBC client: by selecting it in SQL.
[[alternative HTML version deleted]]
__
R-help@r-project.org
But note too what the help says:
Performance considerations:
If you are doing a lot of regular expression matching, including
on very long strings, you will want to consider the options used.
Generally PCRE will be faster than the default regular expression
engine, and
Hi Jim,
I am using this code and it is working well. I convert everything to MB. I
may not fully understand levels(data$Used)[data$Used]) but I use
it everywhere and it works.
data$Used - as.numeric(levels(data$Used)[data$Used])/(1024*1000)
data$Committed -
Yes, but I dont know how can I SELECT the infos from one column. Columns
have no names in my excel. I tried it
jo-odbcConnectExcel2007(D:\\MA\\excel_mix_meiningen.xls)
dfr - sqlQuery(jo,SELECT top 1 F1 FROM `Tabelle1$`)
close(jo)
dfr
but I get an error:
[1] 07002 -3010 [Microsoft][ODBC Excel
Dear experts:
In MATLAB, functions cannot see variables outside the
functions. However, in R, the functions can do that. Is there
any settings that can disable this ability of functions?
Many thanks for your kind help.
Best Regards Always.
[[alternative HTML version
Dear R-helpers,
Glad to write to you.
I would like to have your helps to install packages through internet, in a
linux computer. Could you please share any of your expertise with me on
this problem?
Thanks in advance.
Best
Jian-Feng,
# check the
y - c(5.5199668, 1.5234525, 3.3557000, 6.7211704, 7.4237955, 1.9703127,
+ 4.3939336, -1.4380091, 3.2650180, 3.5760906, 0.2947972, 1.0569417)
x - c(1, 0, 0, 4, 3, 5, 12, 10, 12, 100, 100, 100)
fn-function(x,y){
+ lreg-lm(y ~ x)
+ }
fn(x,y)
b-coef(fn)
Error:
Thanks everybody! Now I understand the need for more details:
the patterns for the gsubs are of different kinds.First, I have character
strings, I need to replace. Therefore, I have around 5000 stock ticker symbols
(e.g. c(‚AAPL’, ‚EBAY’,…) distributed across 10 vectors.
Second, I have four
Hello,
You are trying to get the coefficients of the function, nt of that
function's result. Also, your function returns nothing. Try instead
fn - function(x,y){
lreg - lm(y ~ x)
lreg
}
fit - fn(x,y)
b - coef(fit)
b
Hope this helps,
Rui Barradas
Em 05-11-2013 10:56, IZHAK
Hello,
I believe the answer is no. Functions will first look in their
environment, and then in the parent frame, i.e., outside the function.
Hope this helps,
Rui Barradas
Em 05-11-2013 10:42, Zhong-Yuan Zhang escreveu:
Dear experts:
In MATLAB, functions cannot see variables outside
On Nov 5, 2013, at 4:38 AM, Mao Jianfeng jianfeng@gmail.com wrote:
Dear R-helpers,
Glad to write to you.
I would like to have your helps to install packages through internet, in a
linux computer. Could you please share any of your expertise with me on
this problem?
Thanks in
On 05/11/2013 12:25, Rui Barradas wrote:
Hello,
I believe the answer is no. Functions will first look in their
environment, and then in the parent frame, i.e., outside the function.
That is not correct. The scoping rule when evaluatiing a function is to
look first in the evaluation frame,
My feeling is that the **result** you want is far more easily achievable via
a substitution table or a hash table. Someone better versed in those areas
may want to chime in. I'm thinking more or less of splitting your character
strings into vectors (separate elements at whitespace) and chunking
Hi
Although I do not know about SPACECAP here are few hints.
Usually attachment does not go through, use dput instead.
Copy output of
dput(head(yourdata))
to the mail.
str(yourdata)
Gives you (and us if you show the output) some info about your data mode.
My opinion is that some column is
Hi
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of Ryan
Sent: Monday, November 04, 2013 4:19 PM
To: David Winsemius
Cc: r-help@r-project.org
Subject: Re: [R] forecast.lm() and NEWDATA
Hi David (and everyone)
Thank you
Why would you want to impose this restriction? Perhaps if you explain what
you are trying to do, we can suggest approaches that will satisfy your
specific needs.
(note- one can always redefine whatever variables are to be excluded. E.g.
to keep the body of a function from referring to 'foo' in
Can you use those programs to get to the package tar file directly:
http://ftp.ctex.org/mirrors/CRAN/src/contrib/ggplot2_0.9.3.1.tar.gz
If so, you might want to download it and then install as a local package
installation on the remote server from the CLI (eg. using R CMD INSTALL ...).
You
Hi Marc,
Thanks a lot for your reply.
In fact, I am running R in a remote linux server. I am wondering there are
some special settings for Internet access in this server. I have ever tried
to use different CRAN mirrors, and failed. I can use lftp, wget, curl
to link to internet, in this server.
Dear John,
Thanks for your help. I run the path analysis but the model does not fit
the data. I am in doubt if this reflects the model construction et al. (too
many variables or more needed, more paths or change in direction of paths,
sample size, etc) or it could be that there is an
I have responded to this particular misconception so often I begin to grow grumpy about it
(not the particular fault of YH). The cumulative hazard function from
fit - coxph( some model)
sfit - survfit(fit, newdata= set of covariate values)
gives the survival curve and
Hi experts,
I want to read only the half of my data frame, which I read it from clip
board, and save it in a list. I wrote this code but it doesnt work:
ck-read.table(clipboard)
datalist-list()
d-dim(ck)[1]
i-1
repeat
{
datalist-c(datalist,ck[i,])
i-i+2
if(id)
{break}
}
datalist
Hi All,
What formula can I use to determine the right sample size for clustering
analysis with 100-300 variables?
What sampling methodology can be used for k-means or hierarchical clustering on
categorical fields so that all values of the categorical fields are included in
the sample?
Thanks
Dear all,
I hope that is the right list for my question
Here is the case:
I want to describe an histogram as the sum of several distributions, and
thus to fit these distributions on that histogram. In ROOT/C++ that is
pretty obvious, but I look for the equivalent in R. Here is a
Hello
i want to compute the Nadaraya-Watson kernel estimation when the kernel
function is Epanchincov kernel
i use the command
ksmooth(x, y, kernel=normal, bandwidth ,)
the argmunt ( kernel=normal ) accept normal and box kernels
i want to compute it if the kerenl = Epanchincov
thank
You don't need a loop nor a growing object.
data(mtcars)
mtcars
mtcars[seq(1, nrow(mtcars), by = 2), ]
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Kliniekstraat 25
1070
Hi
You shall probably use C or similar program for such task.
As I understand you want only odd rows. If yes, this will do it for you
odd-seq(1,d,2)
datalist-cd[odd,]
If not please explain better your real intention.
Regards
Petr
-Original Message-
From:
Sorry
shall be
datalist-ck[odd,]
Regards
Petr
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of PIKAL Petr
Sent: Tuesday, November 05, 2013 3:56 PM
To: Baro; R help
Subject: Re: [R] Problem while reading Data from a data
thank you for your answers. It works and I have such an output:
[1] 491 492 494 492 493 492 494 493 493 492 491 491 493 494 492 493 494 492
493 492 491 494 492 491 493 495
[27] 492 492 491 493 492 493 495 493 492 491 494 493 492 491 491 494 492
493 492 492 492 492 494 492 491 493
[53] 493 493 494
On 11/4/2013 9:13 AM, thomas wrote:
Dear list,
I'd like to create a visual plot of a clmm() I've fitted using the
'ordinal' package in R. It's possible to do this with a glm() by using
the 'effects' package. For example:
library(effects)
data(BEPS)
mod - lm(political.knowledge ~
How to write a blob with RDBI?
assuming I have
x - 1:10 * 0.1
How do I store it in a sql table as an blob?
regards
--
Witold Eryk Wolski
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting
From: aljehan...@hotmail.com
To: r-help@r-project.org
Subject: Nadaraya-Watson kernel
Date: Tue, 5 Nov 2013 17:42:13 +0300
Hello
i want to compute the Nadaraya-Watson kernel estimation when the kernel
function is Epanchincov kernel
i use the command
ksmooth(x, y, kernel=normal, bandwidth
Hi
It means that what you read is a factor. Most probably the values are formated
in scientific notation which is not read properly as numbers. You shall format
numbers in your Excel file so that it does not have comma but dot.
Or you can transfer those values to numbers in R.
see
?factor
I exactly jump over this values and only have the integer values, henc I
want to read only odd rows
On Tue, Nov 5, 2013 at 7:31 AM, PIKAL Petr petr.pi...@precheza.cz wrote:
Hi
It means that what you read is a factor. Most probably the values are
formated in scientific notation which is
Please follow Petr's advice and read the Introduction to R or other R
online tutorial (there are many) before posting further basic
questions here. You need to make an effort to learn the basics of R
before pestering this list with questions such as these.
Cheers,
Bert
On Tue, Nov 5, 2013 at
Read
?as.numeric
?as.character
Anyway. There is really extensive documentation coming with R. By using it you
can save your time quite considerably.
Here is snippet from FAQ
7.10 How do I convert factors to numeric?
It may happen that when reading numeric data into R (usually, when reading in
thanks :)
On Tue, Nov 5, 2013 at 7:45 AM, PIKAL Petr petr.pi...@precheza.cz wrote:
Read
?as.numeric
?as.character
Anyway. There is really extensive documentation coming with R. By using it
you can save your time quite considerably.
Here is snippet from FAQ
*7.10 How do I
Dear Thomas and Michael,
As Michael knows, there is a default Effect() method in the development
version of the effects package on R-Forge. This should work with almost all
model objects that produce a single fitted value and that respond to coef(),
model.frame(), formula(), and vcov().
This
Let's say I have the following data frame and the date column has two
different ways in which date is presented. How can I use as.Date or the
lubridate package to have one date structure for the entire colum
df = data.frame(Date=c(5/1/13,8/1/13,9/1/13,Apr-10,
Apr-11,Apr-12,Apr-13))
[[1]]
[,1] [,2]
[1,] 0.003632559 0.2190629
[2,] -2.090772847 0.2190629
[[2]]
[,1] [,2]
[1,] 0.004278991 0.04337005
[2,] 0.190723602 0.04337005
[[3]]
[,1] [,2]
[1,] 0.01237827 -0.01544811
[2,] 0.06452200 -0.01544811
g-c(1,2,3)
Hello,
Try the following.
idx - grep([[:alpha:]], df$Date)
Date - as.Date(df$Date, %m/%d/%y)
Date[idx] - as.Date(paste(01, df$Date[idx]), %d %b-%y)
Hope this helps,
Rui Barradas
Em 05-11-2013 16:00, Abraham Mathew escreveu:
Let's say I have the following data frame and the date column
On 4 Nov 2013 19:30, David Winsemius dwinsem...@comcast.net wrote:
Maybe you should use their download facility rather than trying to
deparse a complex webpage with lots of special user interaction features:
http://appsso.eurostat.ec.europa.eu/nui/setupDownloads.do
That web page depends on
Dear Sarah,
As you know, our discussion continued off-list, and I'm glad that you were
able to get the software to work.
I'll address your question briefly, but what I have to say probably isn't
what you want to hear:
Most fundamentally, the information you've provided is entirely without
Hi,
May be this helps:
set.seed(42)
list1 - lapply(1:3, function(i) matrix(rnorm(4),2,2))
g - c(1,2,3)
fun1 - function(g,hessianList){
mat1 - vector(mode=list,length=length(g))
for(i in seq_along(g)){
mat1[[i]] - g[i]*hessianList[[i]]
}
Reduce(`+`,mat1)
}
HI,
You could try:
library(lubridate)
Date1 - mdy(as.character(df[,1]))
Date1[is.na(Date1)] -
parse_date_time(paste(1,as.character(df[,1][is.na(Date1)]),sep=-),%d-%b-%y)
A.K.
On Tuesday, November 5, 2013 12:38 PM, Abraham Mathew abmathe...@gmail.com
wrote:
Let's say I have the following
It's easier for folks to help you if you make your data available by
reproducible code. You can do this using the dput() function. So, for
example, you could share your hessianList with us using
dput(hessianList)
and then including this code in your post
hessianList -
Hi,
You may try:
dat1 - structure(list(SubID = 1:8, CSE1 = c(6L, 6L, 5L, 5L, 5L, 5L,
3L, 3L), CSE2 = c(5L, 4L, 5L, 4L, 6L, 4L, 6L, 6L), CSE3 = c(6L,
7L, 5L, 3L, 7L, 3L, 6L, 6L), CSE4 = c(2L, 2L, 5L, 4L, 5L, 6L,
3L, 3L), WSE1 = c(6L, 6L, 5L, 4L, 6L, 4L, 6L, 6L), WSE2 = c(2L,
6L, 5L, 4L, 4L,
Dear all,
I have about 50 pages of R codes and ran it in both OS X and Windows.
It takes at least haft a day to have the results. The running time is not very
different in both Systems.
I found that R does not use all cores of CPU by default.
Can anybody help me to use all cores of CPU in my
Mcapply from package 'parallel'. Also see package 'multicore'
Am 06.11.2013 um 00:01 schrieb Agony agony_...@yahoo.com:
Dear all,
I have about 50 pages of R codes and ran it in both OS X and Windows.
It takes at least haft a day to have the results. The running time is not
very
This looks as though you need to be a little XML old-school.
readHTMLTable is a summary function drawing on:
?htmlTreeParse() turns the table into xml
?xpathApply()
and more.
#xpathApply(doc, , //td, function(x)xmlValue(x)) breaks each line at
the end of a table cell and extracts the value
#
On 06.11.2013 00:26, Simon Pickert wrote:
Mcapply from package 'parallel'. Also see package 'multicore'
Not mcapply: it won't work under Windows that the OP asked for.
But package parallel is the right hint. It also provides other
parallelization techniques that will work under Windows.
On Tue, Nov 5, 2013 at 3:36 PM, Uwe Ligges
lig...@statistik.tu-dortmund.de wrote:
On 06.11.2013 00:26, Simon Pickert wrote:
Mcapply from package 'parallel'. Also see package 'multicore'
Not mcapply: it won't work under Windows that the OP asked for.
But package parallel is the right
Hello,
I am working through examples of generating Home Range using the
adehabitatHR package. Everything is going fine until I load the code for the
kernelUD function, it looks like this;
data(puechabonsp)
kud - kernelUD(puechabonsp$relocs[,1], h=href)
kud
I then get an error of; Error:
I am running a multi-level model. I use the following commands with
validatedRS6 as the outcome, random as the predictor and clustno as the
random effects variable.
new-as.data.frame(read.delim(BABEX.dat, header=TRUE))
install.packages(lme4)
library(lme4)
model1- glmer(validatedRS6 ~ random +
I'm trying grnn package, and reproduced the example (
http://cran.r-project.org/web/packages/grnn/grnn.pdf), I tried the example
with another x input column in the dataset:
but I'm getting the following error Error in Ya * patterns1 :
non-conformable arrays, though I took care to pass an input
On Nov 5, 2013, at 3:36 PM, EmmaB wrote:
I am running a multi-level model. I use the following commands with
validatedRS6 as the outcome, random as the predictor and clustno as the
random effects variable.
new-as.data.frame(read.delim(BABEX.dat, header=TRUE))
install.packages(lme4)
I'm trying to do some post-plot manipulation of some lattice graphics, in which
I need to get the absolute viewport locations on the plotting device. So for
example:
library(lattice)
print(xyplot(Petal.Length ~ Sepal.Length | Species, iris, layout = c(2, 2)))
trellis.focus('panel', 1, 1)
This
str(new)
'data.frame': 1214 obs. of 4 variables:
$ ï..VAR1 : logi NA NA NA NA NA NA ...
$ random : int 1 1 1 1 1 1 1 1 1 1 ...
$ clustno : int 1 1 1 1 1 1 1 1 1 1 ...
$ validatedRS6: int 0 0 0 0 0 0 0 0 0 0 ...
--
View this message in context:
Hi All,
Are there any package to check the GOF for nonparametric copulas using R?
Fayyad
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
Hi there
I'm having a bit of trouble with my code that I'm writing.
Essentially I'm trying to do a rolling eGARCH forecast for a dataset, namely
DataExplorers which is a portfolio of gold exploration stocks.
I'm hoping to get it so that it calculates the eGARCH for each day and
refits itself
63 matches
Mail list logo