Displaying 20 results from an estimated 1000 matches similar to: "Matrix manipulation"
2009 Sep 02
5
pruning data
Hello everyone,
I am trying to prune a data frame for partial least squares analysis.
I need to delete an entire row if one cell in the row contains a NA.
Presently, I am running a loop that is supposed to extract the rows
that are full of numbers into a second data frame and skips the rows
that contain a single NA value.
I want to know if there is a simple way to determine if a row
2009 Jun 12
3
Referencing data frames
Hi,
How do I use the string content of a string variable to reference a data frame of the same name? I want to do the typical tasks of 1) building a name with a string variable and using the string variable to create a data frame (or any object) whose name is the string value of the variable and 2) pass on a string to a function as a parameter, and then use that string to refer to an existing
2009 Aug 28
2
Pls package
Hi,
I have managed to format my data into a single datframe consisting of two AsIs response and predictor dataframes in order to supply the plsr command of the pls package for principal components analysis.
When I execute the command, however, I get this error:
> fiber1 <- plsr(respmat ~ predmat, ncomp=1, data=inputmat,validation="LOO")
Error in model.frame.default(formula =
2009 Jun 25
2
Placing text outside graph boundary
Hello,
Is possible to place a label on a multipanel figure outside the boundaries of any single one of the existing graphs in a panel?
Specifically, I have a function that creates a panel with quartz() and then fills it with 6 graphs consisting of exactly the same plot for 6 different groups. I would like to add one title for the entire figure at the top of the figure, but I cannot figure out
2009 Sep 21
2
How to handle missing values for the GeneMeta package?
Hello all,
It seems that the GeneMeta passage returns NA in the respective row if
any gene in the data sets to be synthesised are missing. Do you know
of a way to overcome this problem?
I tried using the 'impute' package to fill-in the missing values, but
R crashes if 'impute' and 'GeneMeta' packages are used together. I
have asked a separate question for that.
Thanks
2009 Jun 11
2
More basic question
I have encountered a more fundamental problem in my data set. I''m using read.csv, and all the data are imported as character. How do I do a string comparison in a line like this:
M10[ !sapply(1:10, function(x)666 %in% M10[x,]), ]
Alternately, how do I change the class type on a column in a data frame from character to numeric?
Thank you very much.
Payam
[[alternative HTML version
2009 Jun 15
2
Help with syntax error
Hi,
I have written boxplot commands of this form before, but I don''t quite understand why the function call is reporting a syntax error in this instance. All parameters passed to the function are strings.
Thanks in advance.
Payam
> simplevar <- function(wframe,column1,column2) {
+ tframe <- get(wframe)
+ x1 <- which(names(wframe)==column1)
+ x2 <-
2009 Jun 15
0
books on Time serie
A time series text with a title that seems designed to hide its
wide scope is:
Forecasting with Exponential Smoothing
The State Space Approach
Hyndman, R.J., Koehler, A.B., Ord, J.K., Snyder, R.D.
Springer 2009.
This book is actually an excellent overview of time series theory,
ARIMA as well as state space. It is of course, in part, a manual
for the forecast and other packages in what has been
2009 Jun 12
1
Extracting the name of an object
With apologies if I missed the answer in the response given to my previous question.
How do I extract the name of an object and assign it to a string variable?
For example, I have a dataframe named comnoglyc
How do I assign this name to a variable dfname such that print(dfname) returns "comnoglyc"?
Thank you very much.
Payam
[[alternative HTML version deleted]]
2003 Jan 24
3
win98 & samba file server
Hello everybody,
it's a few minutes that i've subscribed in your mailing list.
nice to meat all of you.
I have samba on redhat 8 as a file server for a couple of "win98" &
"winXP"'s.It work's for my XP OS's but I don't know how to join the "win98" 's in.
please help me
thanks
payam.
2009 Nov 28
3
extract coordinates from contour lines
To everyone,
Is there a way to extract coordinates or an equation from a "straight" contour line?
Thanks.
Cheers
Julius Tesoro
2004 Aug 31
3
XP Problems adding machines "on the fly"
Having trouble with the add machine script. Followed the chapter 6
how-to, but, it fails. Checking log file for the machine after
error-RPC call failed on XP box, I find a 101MB log file filled with
-error must provide name- something to that effect. Any help would be
appreciated. smb.conf follows.
[global]
workgroup = FSK
netbios name = Camarillo
server string = Camarillo
2013 Feb 07
4
help with creating new variables using a loop
Hi there,
I've got a set of 10 numeric variables called Mood1 to Mood10 in a dataset called mood. I'm trying to create a set of 10 new variables called m1 to m10 so that m1=Mood1*1, m2=Mood2*2, etc to m10=Mood10*10
Trawling through the internet, I eventually tried the following code:
for (i in 1:10){
assign(x=paste0("mood$m",i),
2009 Apr 22
4
read.table or read.csv without row index?
Hello all,
Probably my concepts about the data.frame and matrix and array in R
are not clear, I need some clarification to help me understand them
better.
>M <- read.table("test1.csv",sep=",",row.names=NULL,header=T)
gives me: M as
M1 M2 M3 M4 M5 M6 M7 M8 M9 M10
1 9 11 14 15 18 20 20 20 20 20
2 3 4 8 9 11 12 14 15 15 15
3 4 5 8 8 9 9 9 9 9 9
4 4
2003 Jun 26
1
Correct contrast for unreplicated 2K factorial design
Hi all,
I have been trying to reproduce an analysis from Douglas Montgomery?s
book on design and analysis of experiments. Table 6.10 of example 6.2 on
page 246, gives a table as follows:
> NPK <- expand.grid(A=mp,B=mp,C=mp,D=mp)
> Rate <- c(45,71,48,65,68,60,80,65,43,100,45,104,75,86,70,96)
> filtration <- cbind(NPK,Rate)
> filtration
A B C D Rate
1 - - - - 45
2
2009 Sep 27
1
Select.spatial on spplots
Hi everyone. I posted this on R-sig-geo but got no response.
Can select.spatial() be used in an existing spplot? I have tried selecting points (eq) from a plot generated from sp. However, when I invoke select.spatial(eq). It generates only the points without the background containing the faults. I need the background to select which earthquakes coalesce on which fault. Is there an alternative?
2009 Oct 17
2
ozone data
Hi just a quick inquiry
Sorry if this is too trivial but I am just a beginner in R.
I am looking at the plyr package and I am intrigued at how data(i.e. ozone, baseball) is loaded without having to type data(ozone). Are they automatically loaded when i call library(plyr)? I want to do the same thing when I make my package. How does one accomplish this?
Also, are there any beginner guides on how
2009 Aug 08
1
frequency of numbers in a list
Hi,
I have two vectors, mag and i, and I want to generate a of vector where each element is the frequency of mag which is greater than i.
i produced the following code. However I get the following error:
mag<-rnorm(40,5,3)
i<-seq(floor(min(mag)),max(mag), 0.5)
freq<-sum(mag>=i)
Warning message:
In mag >= i :
longer object length is not a multiple of shorter object length
2005 Feb 08
15
Few questions
Hi,
I have a few problems with my shorewall configuration.
First of all, the option maclist seems no to be recognized.
I have this:
ghostwheel /etc/shorewall # cat interfaces | grep -v ''^#''
- eth1 detect dhcp,tcpflags,routefilter
loc eth0 detect tcpflags,maclist
When I look at shorewall-init.log, I found out:
2008 Dec 26
3
lm() with same formula but different column/factor combinations in data frame
Hi,
I am trying to find an efficient way of applying a linear regression
model to different factor combinations in a data frame.
I want to obtain the output with minimal or no use of loops if
possible. Please let me know if this query is unclear.
Thanks,
Murtaza