Displaying 20 results from an estimated 1200 matches similar to: "optimising a loop"
2013 May 22
1
column width in .dbf files using write.dbf ... to be continued
Hello Arnaud,
You posted this question a long long time ago, however I found your answer so I decided to post it anyway in case somebody else have the same problem as you and me.
You were actually very close in finding your solution. The function DoWritedbf is an internal function from the foreign package. To access it outside of the package just do:
foreign:::DoWritedbf
so in your line:
2010 Oct 06
1
R getting slower until it breaks...
Hello R-users,
I'm currently facing a pretty hard problem which I'm hopping you'll be able to help me with. I'm using R to create images. That alone is not the problem, the problem is that I'm using R to create 168 000 images... My code (which is given below) use different package (raster and rgdal) to import a image (size 20gig) and divide it into 168 000 pictures that are
2010 Sep 17
2
grouping dataframe entries using a categorical variable
DearR Users,
I have a problem which I think you might be able to help. I have a dataframe which I'm trying to "filter" following different groups I specified. It's a little hard to explain, so here is an example:
My dataframe:
ESS DHP
1 EPB 22
2 SAB 10
3 SAB 20
4 BOJ 14
5 ERS 28
11 SAB 10
12 SAB 22
13 BOJ 26
20 SAB 10
21 SAB 22
22 BOJ 32
29 SAB 14
30 SAB
2008 Oct 28
2
Fitting weibull and exponential distributions to left censoring data
Dear R-users
I have some datasets, all left-censoring, and I would like to fit
distributions to (weibull,exponential, etc..). I read one solution using the
function survreg in the survival package. i.e
survreg(Surv(...)~1, dist="weibull") but it returns only the scale
parameter.
Does anyone know how to successfully fit the exponential, weibull etc...
distributions to left-censoring
2008 Feb 11
0
Curious
Hello Flac Boys!
I've a little thing, without consequences, I try to understand since last evening; I will try to resume it clearly :
You must know that I create an NTFS partition, for only coding my CD's in FLAC (for home using) and in MP3 (for car using).
My partition inculudes some directories called WAV, FLAC and MP3, amongst others, for personal and paranoiac purposes (double
2004 Jul 08
7
Problem with the grep function
Let me present to you my problem :
I have a character vector x and I would like to obtain the indices of the
elements of
this vector that yielded exactly a match.
For example, x=nom, pattern="b", I would to obtain 2 because "b" is on the
second position.
First program :
nom <- c("a","b","ab")
grep("b",nom)
2 3
Then I try the
2013 Jul 24
3
Change values in a dateframe
Hello
I have the following problem :
The dataframe TEST has multiple lines for a same person because :
there are differents values of Nom or differents values of Prenom
but the values of Matricule or Sexe or Date.de.naissance are the same.
TEST <- structure(list(Matricule = c(66L, 67L, 67L, 68L, 89L, 90L, 90L,
91L, 108L, 108L, 108L), Nom = structure(c(1L, 2L, 2L, 4L, 8L,
5L, 6L, 9L, 3L, 3L,
2005 Jun 06
2
How to vectorize
Dear R-List,
I would like to write nicely the names of some isotopes on a plot. The
code bellow works fine.
plot(1:10,1:10)
text(c(2,4,8),c(2,4,8),labels=c(expression(italic(phantom(0)^{78}*Ge)),
expression(italic(phantom(0)^{137}*Cs)),
expression(italic(phantom(0)^{129*m}*Te))),
cex=3
)
But, since I have a lot of
2005 Jun 06
2
How to vectorize
Dear R-List,
I would like to write nicely the names of some isotopes on a plot. The
code bellow works fine.
plot(1:10,1:10)
text(c(2,4,8),c(2,4,8),labels=c(expression(italic(phantom(0)^{78}*Ge)),
expression(italic(phantom(0)^{137}*Cs)),
expression(italic(phantom(0)^{129*m}*Te))),
cex=3
)
But, since I have a lot of
2015 Oct 09
3
reverse object creation
Dear all,
this is my first message to this mailing list - please advise if it is not
the right place for the subject
I've been using R very intensively the last 3-4 years and one of the most
tedious tasks is modification of lookup or conversion tables
So far, I have not found functions that create the commands for creating
objects (vectors, data frames) based on the objects themselves -
2013 Jul 17
2
Dovecot 2.2.4/sendmail with sql user and aliases
Hi,
We are currently moving from linuxconf/dovecot to a dovecot setup with
sql support, the problem we currently facing is having a message sent to
a aliase delivered to the user email inbox with dovecot-lda, i have
created cedrict at mail.vdl and a alias test at mail.vdl, when i send to
cedrict at mail.vdl the message is included in the user inbox file, but
when i send to test at mail.vdl
2006 May 16
1
variable row names
Hy all,
I wish to use a variable as rownames for a set of datas.
By example :
> nom<-"toto"
> prenom<-"tutu"
> res<-c(1,2)
> res<-t(res)
> res
[,1] [,2]
[1,] 1 2
> colnames(res)<-c(nom,prenom)
> res
toto tutu
[1,] 1 2
> nom
[1] "toto"
>
I wish to call the rowname by the
2005 Jun 22
1
How to use expression in label with xYplot
Dear R-List,
I want to use the label function (from Hmisc library) to allow for the
names of my isotopes.
library(Hmisc)
library(lattice)
library(grid)
num <- c("78","137","129m")
nom <- c("Ge","Cs","Te")
df <- data.frame(GE78=seq(nom),CS137=seq(nom),TE129m=seq(nom))
if I use this function to create the labels :
lab <-
2006 Apr 25
3
select boxe
yop,
http://rubyonrails.org/api/classes/ActionView/Helpers/FormHelper.html
ici j''ai vu qu''on pouvait g?n?rer des ?l?ment d''un formulaire gr?ce des
m?thodes. Apres quelque petite recherches j''ai trouv? comment g?n?rer un
select
<%= select(''category'', ''category.id'', Category.find_all.collect {|category|
category.nom})
2012 May 02
2
Problem with 'nls' fitting logistic model (5PL)
Dear R-Helpers,
I'm working with immunoassay data and 5PL logistic model. I wanted to
experiment with different forms of weighting and parameter selection,
which is not possible in instrument software, so I turned to R.
I am using R 2.14.2 under Win7 64bit, and the 'nls' library to fit the
model - I started with the same model and weighting type (1/y) as in the
instrument to see
2002 May 11
2
RODBC sqlFetch
Hi,
Thanks for showing me how to use RODBC and odbcConnect.
Now works nicely. The question I've got now is:
noms <- list.files(pattern=".DBF")
# removing extension names:
noms <- sapply(noms, function(x) as.character(strsplit(x,".DBF")) ,
USE.NAMES=F)
for (i in 1:length(noms)) {
s <- sqlFetch(bdades, noms[i])
# etc.
}
But it seems that sqlFetch()
2007 Jun 06
2
names not inherited in functions
Dear all,
I 'd like to keep the names of variables when calling them in a function.
An example might help to understand my problem :
The following function puts in a new data frame counts and percent of
a data.frame called as "tablo"
the step " nom.chiffr[1] <- names(vari) " is useless as names from the
original data.frame aren't kept in the function environement.
2011 May 15
5
Question on approximations of full logistic regression model
Hi,
I am trying to construct a logistic regression model from my data (104
patients and 25 events). I build a full model consisting of five
predictors with the use of penalization by rms package (lrm, pentrace
etc) because of events per variable issue. Then, I tried to approximate
the full model by step-down technique predicting L from all of the
componet variables using ordinary least squares
2013 Jul 12
4
simplify a dataframe
Hello
I have the following problem : group the lines of a dataframe when no
information change (Matricule, Nom, Sexe, DateNaissance, Contrat, Pays)
and when the value of Debut of lines i = value Fin of lines i-1
I can obtain it with a do loop. Is it possible to avoid the loop ?
The dataframe initial is df1
dput(df1)
structure(list(Matricule = c(1L, 1L, 1L, 6L, 6L, 6L, 6L, 6L,
6L, 8L, 8L, 8L,
2002 May 18
2
can't connect from windows
Hello all,
I've setup samba Version 2.2.0a on Slackware 8.0
# uname -a
Linux slackware 2.4.5 #6 Fri Jun 22 01:38:20 PDT 2001 i686 unknown
I start samba as root from a console as:
/usr/sbin/smbd -D -d10 -l /var/adm/smblogs/log -s /etc/samba/smb.conf
/usr/sbin/nmbd -D -d1 -s /etc/samba/smb.conf
In smb.conf I have:
[files]
comment = mystuff
valid users = nigels
path = /usr1
read