similar to: Return variable assignments from a function

Displaying 20 results from an estimated 10000 matches similar to: "Return variable assignments from a function"

2007 May 16
3
Reshape a sparse matrix
Hi, I'd like to reshape a sparse matrix generated from the Matrix package. I can't seem to do it with the command dim(A) <- c(6,9) which works perfectly with the base package matrices, but with the sparse matrices it errors with Error in dim(A) = c(6, 9) : dim<- : invalid first argument Manipulating the Dim attribute of the sparse Matrix does not produce the desired effect. A
2007 May 21
3
an array of matrices
I'd like to have a three dimensional array of matrices. I thought I could construct a five dimensional array to have the three dimensional array of matrices. However, not all of the matrices in the array have the same dimensions, which seems to mean I can't use a five dimensional array. What I'd like is this: A = matrix(1:4,2,2) B = matrix(1:25,5,5) C = matrix(1,3,3) D =
2010 Dec 22
2
how to pass object "members" in functions
Hello, This is an R-syntax question when attempting to manipulate/access objects when passed to a function. I have a function attempting to just print values attached to an argument object. For example, printThis <- function(obj, parm2, parm3) { print(obj.stuff1) print(obj.stuff2) } where I've assigned stuff1 and stuff2 to the actual object passed as such actualObject.stuff1 <-
2007 Apr 18
2
Checking validity of NHS numbers
Hello I need to check that the NHS numbers in my database are valid. I''m storing them as ten-digit strings: the first nine are the identifier and the tenth is a check digit. There are four steps to calculating the check digit (from http://www.connectingforhealth.nhs.uk/systemsandservices/nsts/docs/tech_nn_check_digit.pdf): 1. multiply each of the first nine digits by a weighting factor
2007 Sep 14
2
Cross Compiling
Hello All, I have a Linux computer and do all of my work from it. However, I teach also, which means that many of my students use windows. Hence, I need to create packages that work under windows as well as Linux. I have tried to follow the directions at http://cran.r-project.org/doc/contrib/cross-build.pdf which is the document "Building Microsoft Windows Versions of R and R packages
2010 Sep 16
5
using variable from for loop in naming new variables
Simple one here ... but can't get it to work ... for (i in 1:4){ paste("stuff",[i]),sep="") <- 3 + i } ls() rm(list=ls()) I just want it to create 4 new variables called stuff1, stuff2, stuff3, stuff4 with the corresponding assignments. I realise that there are more elegant functions but this is just a model of a bigger situation. Thanks Jim
2009 Aug 21
1
a --no-save option for Rprofile.site?
I need to set up Rcmdr for use in a testing center that uses Windows. Since it is in a testing center, we don't want to have data saved, and want it cleared (or never saved) each time R or Rcmdr is run. The method I used to get Rcmdr to run automatically is to add the lines: ------------------------------------------------ defpack = getOption("defaultPackages") mylibs =
2005 Oct 27
3
Opteron + Nvidia + Centos 4.2 i386 = Thud
Dear All, Just returned from vacation and was delighted to see that Centos 4.2 is now on the mirrors. Unfortunately the new i386 version is giving us problems on our dual Opteron workstations with Nvidia graphics cards... Basically, nine times out of ten, the boxes will hang when they try to re-load X... and just sit there with the keyboards Caps and Scroll lock LED's flashing. The only
2020 Sep 20
3
help improving relevance of snippets displayed by Omega
Olly, Thanks again very much for helping me improve my understanding of Xapian and Omega. Thanks especially for pointing out that my idea of trying to generate a snippet from stemmed text lacking capitalization and punctuation would probably not produce a user-friendly result. But I'm still doubtful that expanding the sample size could be the right way to obtain excerpts from the document
2008 Mar 03
3
R function to convert a number to text
hi, Dear R users - I wonder is there a written R function to convert a number to a text, say convert 1 to "one" , 100 to "one hundred". I know in xls. has such a function BAHTTEXT, does anybody know is there a similar function in R ? Thanks. Lin --------------------------------- [[alternative HTML version deleted]]
2010 Feb 07
3
Noval numbers
Dear everybody, How can I transform numbers to a positional system with the base of, e.g., nine, and do further operations with them? Thank you in advance Yours, sincerely Mag. Ferri Leberl
2004 Oct 08
2
Evaluating Assignment-Operator R 2.0.0
Dear Helpers, in which way I have to use the assignment-operator evaluating left to right with R 2.0.0? With R 2.0.0 (w2k-installation) the "superassignment" operator '<<-' seems to have a different behaviour compared with R 1.9.1 : > x<<-4 > x [1] 4 > attr(x,'y')<<-5 Error: Object "x" not found > Using earlier
2003 Oct 28
2
formula parsing, using parts ...
I am writing a little abstraction for a series of tests. For example, I am running an anova and kruskal.test on a one-factor model. That isn't a particular problem, I have an interface like: my.function <- function(model,data) { print(deparse(substitute(data))) a <- anova(lm(formula,data)) print(a) if(a$"Pr(>F)"[1] < 0.05) { pairwise.t.test(???) }
2007 Oct 03
2
Shading area under density curves
Hello, I have a question regarding shading regions under curves to display 95% confidence intervals. I generated bootstrap results for the slope and intercept of a simple linear regression model using the following code (borrowed from JJ Faraway 2005): > attach(allposs.nine.d) > x<-model.matrix(~log(d.dist,10))[,-1] > bcoef<-matrix(0,1000,2) > for(i in 1:1000){ +
2005 Apr 07
2
PDC: Logging out from Windows XP SP2 takes a long time
I have samba set up as primary domain controller, and have problems with my Windows XP SP2 machines. Logging in is quick, but most of the time (nine out of ten times) the logout process takes a long time - I do end up rebooting, but once I let it stay and it took a whole hour before it was logged out. It seems to act the same way for all users. Possible sources already eliminated: - I have
2009 Jul 03
2
normalised curve fitting with error bars
Dear List, My data consist of nine columns and about 50,000 rows. It looks like this. -9.0225 3.46464 2.80926 -0.3847 3.73735 1.1058 -2.98936 1.38901 -8.1846 -2.4315 -5.1189 1.8225 3.3798 1.7874 4.693 -3.9286 1.4266 5.7849 -3.4894 -4.0305 3.7879 3.5195 2.9186 2.8685 -6.126 4.978 4.9381 4.5282 3.62558 -3.0455 4.6518 1.39746 0.68652 3.5708 -3.6404 -4.2963 -1.3183 0.6752 -4.0382 -2.5386
2011 Jun 06
1
list demographics
Hi all, I got curious about something, so in proper scientific fashion I obtained some data and analyzed it. Question: what is the female participation in the R-help email list? Data: the most recent list postings, obtained from the website. I took my best shot at classifying the names given in the email header as male/female, but ended with a fair number of unknowns. This dataset had 2797
2000 Jun 08
3
Output args?
Hi, Is there a way to find out if a function was called with an output argument? Or to prevent the printing of large amount of data if the function was called without output argument? Thanks YG -------------- next part -------------- An HTML attachment was scrubbed... URL: https://stat.ethz.ch/pipermail/r-help/attachments/20000608/8d7a01ec/attachment.html
2014 Jul 28
0
lattice, latticeExtra: Adding moving averages to double y plot
Hi lattice users, I would like to add 5-year moving averages to my double y-plot. I have three factors needs to be plotted with moving averages in the same plot. One of these reads off y-axis 1 and two from y-axis 2. I have tried to use the rollmean function from the zoo-packages, but I fail in insering this into lattice (I am not an experienced lattice user). I want to keep the data points in
2020 Sep 19
2
help improving relevance of snippets displayed by Omega
Thanks Olly! But expanding the sample seems like the wrong solution. Is there a way to instead pass a hit or hits from the document to snippet generation? Michael