similar to: creating an index vector within a 'for' loop

Displaying 20 results from an estimated 30000 matches similar to: "creating an index vector within a 'for' loop"

2001 Nov 06
2
Inverse Matrices
I have a problem with finding the inverse of a matrix. I have a square 9x9 matrix, A, and when I do solve(A) to find the inverse I get the following error message: Error in solve.default(A) : singular matrix `a' in solve Has anybody got any ideas as to why this is happening? Thanks Laura Gross _______________________________________________________________________ Never pay another
2002 Jul 20
1
Problems installing 'lattice' package
Dear List I have installed the 'lattice' package by using 'install.package("lattice") It appears to have created a lattice folder in my R library as I would expect. I have tried to call the package by library(lattice) but I am getting the following error message: Error in parse(file, n, text, prompt) : syntax error on line 2018 Could anybody tell me why this is
2002 May 28
1
Missing values in the nlme package
Hi, I am using the nlme package to fit random effects models, however, I have many missing values in my response variable which I cannot just omit. I can't replace the missing values with the mean or median either as this is too simple and would need to use something like imputation or the EM Algorithm. Is there any way of including these missing values since the model will not run when
2003 Jan 24
3
Multinomial Logit Models
Hi I am wanting to fit some multinomial logit models (multinom command in package nnet) Is it possible to do any model checking techniques on these models e.g. residual, leverage etc. I cannot seem to find any commands that will allow me to do this. Many thanks ---------------------- L.E.Gross L.E.Gross at maths.hull.ac.uk
2006 Jan 28
3
Creating 3D Gaussian Plot
Hello, I requested help a couple of weeks ago creating a dipole field in R but receieved no responses. Eventually I opted to create a 3d sinusoidal plot and concatenate this with its inverse as a means for a "next best" situation. It seems that this isn't sufficient for my needs and I'm really after creating a continuous 3d gaussian mesh with a "positive" and
2018 May 08
0
Dinamic variables in loop
Dear Laura, It looks like you want to remove all rows for which each column is NA. You can to that with the code below. na.matrix <- is.na(MyData) all.na.row <- apply(na.matrix, 1, all) MyData[!all.na.row, ] Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
2005 Jul 19
2
Regression lines for differently-sized groups on the same plot
Hi there, I've looked through the very helpful advice about adding fitted lines to plots in the r-help archive, and can't find a post where someone has offered a solution for my specific problem. I need to plot logistic regression fits from three differently-sized data subsets on a plot of the entire dataset. A description and code are below: I have an unbalanced dataset
2012 Dec 14
1
Plotting from a matrix, where column 1 is your x value
Hello, I'm very new to R, and have managed to plot xy graphs, but can't seem to plot a matrix properly. The first column is my time points, and the following columns 2-4 are the replicates of my experiment. I've tried using row.names=1 to make the first column the value for that row (whereas before I had 1-31 sequence) and then my 1st column) but I can't work out how to tell it
2004 Nov 14
2
Exporting to file: passing source name to file name in loop
Hi, I'm having a mental block as to how I can automatically assign filenames to the output of the following code. I am wishing to create a separate .png file for every image created, each of them having a sequential filename ie "sourcefile_index.png" so that I can create a movie from them. Please could someone tell me where I am going wrong? the following code works fine and
2004 Aug 19
2
ROracle and vector elements
Hi there! Is ROracle available for Windows, please? I found a download site, but it's really for UNIX/Linux. Here is a "thought question", please: Why do the vector elements start at location 1 rather than zero, as C does? Thanks in advance! R Version 1.9.1 Windows Sincerely, Laura Holt mailto: lauraholt_983 at hotmail.com
2012 May 22
3
How to remove square brackets, etc. from address strings?
Hello, I'd like to remove the individual pairs of square brackets along with their content - plus the space directly behind it - from address strings such as this: [Swidsinski, Alexander; Loening-Baucke, Vera; Lochs, Herbert] Charite Humboldt Univ, Innere Klin, D-10098 Berlin, Germany; [Hale, Laura P.] Duke Univ, Med Ctr, Dept Pathol, Durham, NC 27710 USA I'd like get the
2018 Mar 02
1
Variable centring within "predict.coxph"
Dear R-help, I am using R-3.3.2 on Windows 10. I teach on a course which has 4 computer practical sessions related to the development and validation of clinical prediction models. These are currently written for Stata and I am in the process of writing them for use in R too (as I far prefer R to Stata!) I notice that predictions made from a Cox model in Stata are based on un-centred variables,
2018 May 08
2
Dinamic variables in loop
Hello, I am a newbie in R and I have a problem. I want this line: newMyData <-MyData[!(is.na(col1)) | !(is.na(col2)) | !(is.na(col3)) | !( is.na(col4)) | !(is.na(col5)),] write in for loop. The number of col[number] may be different from 3 to 8 Is there any ideas? Thank you Laura [[alternative HTML version deleted]]
2004 Nov 16
2
changing character to a vector name
Dear R People: I would like to generate a vector/variable name from within a loop to be passed to a table function. This is what I have so far: >assign("p1",paste("raw3.df$",rw2$V1[3],sep="")) >p1 [1] "raw3.df$CITIZEN" > Essentially, I want to use the raw3.df$CITIZEN along with another value to generate a table. However, I'm stuck here. I
2011 Nov 14
3
max & min values within dataframe
dear R-team I need to find the min, max values for each patient from dataset and keep the output of it as a dataframe with the following columns - Patient nr - Region (remains same per patient) - Min score - Max score Patient Region Score Time 1 1 X 19 28 2 1 X 20 126 3 1 X 22 100 4 1 X 25 191 5 2 Y 12 1
2004 Aug 15
3
Stacking Vectors/Dataframes
Hello, Is there a simple way of stacking/merging two dataframes in R? I want to stack them piece-wise, not simply add one whole dataframe to the bottom of the other. I want to create as follows: x.frame: aX1 bX1 cX1 ... zX1 aX2 bX2 cX2 ... zX2 ... ... ... ... ... aX99 bX99 cX99 ... zX99 y.frame: aY1 bY1 cY1 ... zY1 aY2 bY2 cY2 ... zY2 ... ... ... ... ... aY99 bY99 cY99 ...
2017 Nov 07
0
Gluster clients can't see directories that exist or are created within a mounted volume, but can enter them.
> On 6 Nov 2017, at 3:32 pm, Laura Bailey <lbailey at redhat.com> wrote: > > Do the users have permission to see/interact with the directories, in addition to the files? Yes, full access to directories and files. Also testing using the root user. > > On Mon, Nov 6, 2017 at 1:55 PM, Nithya Balachandran <nbalacha at redhat.com <mailto:nbalacha at redhat.com>>
2010 Apr 21
1
Creating artificial environmental landscape with spatial autocorrelation
Dear all: Does anyone have any suggestions on how to make a spatially explicit landscape with spatial autocorrelation in R? In other words, a landscape where all cells have a spatial reference, and the environment values that are closer in space are more similar (positive spatial autocorrelation). Thank you, Laura
2010 May 10
1
R algorithm/package for creating spatial autocorrelation of uniformly distributed landscape values
Dear all: I would like to create a landscape of environmental values that follow a uniform frequency distribution and also have spatial autocorrelation in the landscape. I was wondering if there is an algorithm and/or package out there that creates autocorrelation of values that are distributed according to a non-normal frequency distribution. Any suggestions are greatly appreciated. Thank you,
2011 Oct 18
1
Repeat a loop until...
Dear all, I know there have been various questions posted over the years about loops but I'm afraid that I'm still stuck. I am using Windows XP and R 2.9.2. I am generating some data using the multivariate normal distribution (within the 'mnormt' package). [The numerical values of sanad and covmat are not important.] > datamat <-