Displaying 20 results from an estimated 3000 matches similar to: "printing name of object inside lapply"
2008 Nov 30
1
using survey weights for correlations
Dear list,
I have a data file which includes, alongside various variables representing questionnaire scores, a variable for survey weights computed as the number of observations in the sample drawn from that group divided by the number of observations in the population in the group. I need to calculate a covariance matrix of the questionnaire scores for use in sem. How do I apply the weights?
2007 Aug 21
2
standardized cronbach's alpha?
Hi list members
Any easy way to get standardized cronbach's alpha for a scale, as in SPSS? 
Thanks 
Steve Powell
 
proMENTE social research 
research | evaluation | training & consulting 
Kranj?evi?eva 35, 71000 Sarajevo 
mobile: +387 61 215 997 | office: +387 33 556 865 | fax: +387 33 556 866
Checked by AVG Free Edition. 
17:44
2007 Sep 19
1
SEM - standardized path coefficients?
Dear list members,
In sem, std.coef() will give me standardized coefficients from a sem model.
But is there a trick so that path.diagram can use these coefficients rather
than unstandardized ones?
Thanks
Steve Powell
From: John Fox <jfox_at_mcmaster.ca>
Date: Wed 28 Feb 2007 - 14:37:22 GMT
Dear Tim,
See ?standardized.coefficients (after loading the sem package).
Regards,
 John
John
2007 Sep 24
3
Separate colour for comments in scripts
Hi,
Is it possible to assign a separate colour for comments written with #,
eg:-
#this is a comment
. I am looking to colour them differently from the program text in
R-Editor (not console). Is it possible to do so?
Eg. In Visual basic, the colour for remarks gets green automatically
Regards
Sumit
	[[alternative HTML version deleted]]
2007 Nov 17
1
odf and unzip: unzip not found
hi list members
I am trying to use odfWeave with R 2.5.1 on Windows XP.
 
however when running e.g.
odfWeave(demoFile, outputFile) 
 
I get:
Error in odfWeave(demoFile, outputFile) : Error unzipping file
In addition: Warning message:
unzip not found in: system(zipCmd[2], invisible = TRUE) 
 
presumably my zip and unzip are not set up correctly but I dont know how to do that. I installed zip and
2007 Oct 05
2
Apply vector of labels to columns of data frame
Dear list members
I would like to apply a vector of labels 
v=c("lab1","lab2","lab3")
to a dataframe
df=data.frame(1:3,1:3,1:3)
using some kind of loop or apply function.
Any ideas?
Thanks
 
Steve Powell
Checked by AVG Free Edition. 
17:03
 
	[[alternative HTML version deleted]]
2007 Jul 12
1
ggplot doesnt work in loops?
Dear list members
I am still a newbie so might be asking a stupid question, but I can't get
ggplot to work in a loop (or a "while" statement for that matter).
 
# to take a minimal example - 
mydata$varc = c(1,2,3)
for (i in 1:1){
        jpeg("test3.jpg")
        plot(mydata$varc)
        #ggplot(mydata, aes(x=mydata$varc)) + geom_bar()
        dev.off()
}
this produces
2010 Jun 22
1
"save scores" from sem
Dear expeRts,
sorry for such a newbie question -
in PCA/factor analysis e.g. in SPSS it is possible to save scores from 
the factors. Is it analogously possible to "save" the implied scores 
from the latent variables in a measurement model or structural model 
e.g. using the sem or lavaan packages, to use in further analyses?
Best wishes
Steve Powell
www.promente.org | skype
2006 Mar 10
2
lapply and list attributes
Hi
I have a list that has attributes:
attributes(lis[2])
$names
[1] "150096_at"
I want to use those attributes in a function and then use lapply to
apply that function to every element of the list, eg for simplicity's
sake:
my.fun <- function(x) {
        attributes(x)
}
Then
l2 <- lapply(lis, my.fun)
It seems that "attributes(x)" within the function is not the
2012 May 08
1
what folder to run write_PACKAGES in?
I set up a local repo for testing packages. My packages are not
showing up from the repository when viewed by Linux clients. I suspect
this is a web administrator/firewall issue, but it could be I created
the repo wrongly.  I am supposed to run write_PACKAGES separately in
each R-version folder. Right?
Maybe other novices can use these scripts, if they are not wrong :)
Here's the file
2012 Oct 19
1
multiple graphs, lapply and different titles
I have a list of data.frames, and i want to iterate over this list and
generate graphs with the same title of the data.frame.
I did the graphs with:
lapply(anual, function(x) plot(x[,'chuva'], type='l', xlab= 'anos', ylab =
'Precicipatação(mm)', col='red'))
where anual is list of data.frames. I am plotting just the column "chuva"
at each
2009 Aug 11
1
Passing a list object to lapply
Hello,
I'm having difficulty passing an object name to a lapply function. Can
somebody tell me the trick to make this work?
#Works
T13702 <- TRACKDATA[["13702.xls"]][["data"]]
min(unlist(lapply(list(T13702), function(x) mdy.date(x[1, 2], x[1, 1],
x[1, 3]))))
16553
#Works
d<-2
assign(paste("T",substr(names(TRACKDATA)[d],1,(nchar(names(TRACKDATA)[d]
2003 Aug 11
4
subscripts in lists
I am tying myself in knots over subscripts when applied to lists
I have a list along the lines of:
lis<-list(c("a","b","next","want1","c"),c("d", "next", "want2", "a"))
>From which I want to extract the values following "next" in each 
member of the list, i.e. something along the lines of
2014 Aug 06
3
portableParalleSeeds Package violation, CRAN exception?
I'm writing to ask for a policy exception, or advice on how to make
this package CRAN allowable.
http://rweb.quant.ku.edu/kran/src/contrib/portableParallelSeeds_0.9.tar.gz
Yesterday I tried to submit a package on CRAN and Dr Ripley pointed
out that I had not understood the instructions about packages.  Here's
the part where the R check gives a Note
* checking R code for possible
2013 Feb 26
3
Merging value labels into indicator variable.
I have a vaiable named NAM having value : 1,2,3,4,5,6,7,8,9.  I want to
make an indicator variable that will take value 1 if NAM=7 or NAM=8 or
NAM=9. How can I do that?
I usually do: Var001<- ifelse(NAM==7,1,0) for the simplest case.
	[[alternative HTML version deleted]]
2016 Aug 05
2
Extra copies of objects in environments when using $ operator?
My understanding is that R will not make copies of lists if there is
only one reference to the object. However, I've encountered a case
where R does make copies, even though (I think) there should be only
one reference to the object. I hope that someone could shed some light
on why this is happening.
I'll start with a simple example. Below, x is a list with one element,
and changing that
2005 May 10
4
summary statistics for lists of matrices or dataframes
Is there a simple way to calculate summary statistics for all the
matrices or dataframes in a list? For example:
> z <- list(matrix(c(2,2,2,2), ncol = 2), matrix(c(4,4,4,4), ncol = 2))
> z
[[1]]
     [,1] [,2]
[1,]    2    2
[2,]    2    2
[[2]]
     [,1] [,2]
[1,]    4    4
[2,]    4    4
>
I would like to calculate, for example, the mean value for each
cell. I can do that the hard
2017 Aug 09
2
Fill in empty spaces modified
Hi All?
I was looking at a posting from June-17. I managed to solve it. However,
when I changed the example in the posting, my solution will work only once
at a time which was mentioned by Jim Lemon  on his response to the original
posting. This means that my solution will have to be repeated as many times
as the maximum number of spaces on each gap; something that may not work
well for large
2013 Jan 11
4
count combined occurrences of categories
Dear all,
 
i would like to count the number of times where I have combined occurrences of the categories of 2 variables.
 
For instance, in the dataframe below, i would like to know how many times each author (au1, au2, au3 represent the first, second, third author) is associated with each of the category of the variable 'nam'. The position of the author does not matter.
 
nam <-
2009 Jan 30
3
paste together object names to pass it on to a function
Hello,
I have a maybe trivial question, but I simply don't understand well
enought how to work with text/strings:
I have a rather compelx data structure, a big list with several
sub-lists/dataframes and for certain calculations  (which I do in
loops), I only need a certain group of  sub-lists/dataframes, which I
want to specify with a name vector and paste together the object name
and pass it