similar to: how do I get my data in matrix form?

Displaying 20 results from an estimated 10000 matches similar to: "how do I get my data in matrix form?"

2010 Jun 24
1
read.csv does not find my file (windows xp)
I try to load a file myData <- read.csv(file="C:\\myfolder\\mysubfolder\\mydata.csv", head=TRUE, sep=";") and get this error: Error in file(file, "rt") : cannot open the connection In addition: Warning message: In file(file, "rt") : cannot open file 'C:\myfolder\mysubfolder\mydata.csv: No such file or directory am I overlooking something? I am
2008 Apr 28
2
F values from a Repeated Measures aov
Hi Folks, I have repeated measures for data on association time (under 2 acoustic condtions) in male and female frogs as they grow to adulthood (6 timepoints). Thus, two within-subject variables (Acoustic Condition: 2 levels, Timepoint: 6 levels) and one between-subject variable (Sex:male or female). I am pretty sure my distributions depart from normality but I would first like to simply run a
2011 Nov 23
2
SPSS F-test on change in R square between hierarchical models
Hi, I am wondering if anyone knows how to perform an F-test on the change in R square between hierarchical models in R? SPSS provides this information and a researcher that I am working with is interested in getting this information. Alternatively, if someone knows how I can calculate the test statistic (SPSS calls it F-change?) and dfs that would be helpful as well. The output and the test I am
2009 Aug 25
1
Help with nls and error messages singular gradient
Hi All, I'm trying to run nls on the data from the study by Marske (Biochemical Oxygen Demand Interpretation Using Sum of Squares Surface. M.S. thesis, University of Wisconsin, Madison, 1967) and was reported in Bates and Watts (1988). Data is as follows, (stored as mydata) time bod 1 1 0.47 2 2 0.74 3 3 1.17 4 4 1.42 5 5 1.60 6 7 1.84 7 9 2.19 8 11 2.17 I then
2008 Aug 01
1
importing explicitly declared missing values in read.spss (foreign)
There is a problem when importing an spss-file containing explicitly declared missing values in R using the read.spss function from the foreign package. I'm not sure these problems are the same in every version of spss, I am using the latest version 16.0.2. I included http://www.nabble.com/file/p18776776/missingdata.sav missingdata.sav and
2009 Jul 11
3
Reading data entered within an R program
Dear R-helpers, I know of two ways to reading data within an R program, using textConnection and stdin (demo program below). I've Googled about and looked in several books for comparisons of the two approaches but haven't found anything. Are there any particular advantages or disadvantages to these two approaches? If you were teaching R beginners, which would you present? Thanks, Bob
2003 Jan 20
1
curious code mistakes
hi, know anybody why this happen ? I''m using winedt , the old code saved in an .R call syntax error''s. Curious is, when i''m type below the same code , it works ??? ...imho a print type problem, what i''m never before observed and can''t recognize with my eyes ? P.S. R.1.6.1 /w2k thanks for advance & regards,christian >>getfile <-
2010 Nov 11
2
Kolmogorov Smirnov Test
I'm using ks.test (mydata, dnorm) on my data. I know some of my different variable samples (mydata1, mydata2, etc) must be normally distributed but the p value is always < 2.0^-16 (the 2.0 can change but not the exponent). I want to test mydata against a normal distribution. What could I be doing wrong? I tried instead using rnorm to create a normal distribution: y = rnorm
2012 Jan 09
3
as.numeric() generates NAs inside an apply call, but fine outside of it
Hello- I have rather a messy SPSS file which I have imported to R, I've dput'd some of the columns at the end of this message. I wish to get rid of all the labels and have numeric values using as.numeric. The funny thing is it works like this: as.numeric(mydata[,2]) # generates correct numbers however, if I pass the whole dataframe at once like this: apply(mydata, 1:2, function(x)
2009 Apr 07
2
newbie query: simple crosstabs
I've been playing around with various table tools, trying to construct a fairly simple cross-tab. It shouldn't be hard, but for some reason it turning out to be (for me). If I want to see how many men and how many women agree with a agree/disagree question (coded 1,0), I can do this: >attach(mydata) >mytable <- table(male, q1.bin) # gender and a binary response variable
2007 Apr 29
2
impossible to open SPSS file
Hi, I try to import a SPSS file with foreign but don't succeed. I looked into the help pages but find no answer. The file has been produced with SPSS 15 but I got the same error with a file in SPSS portable format. mydata<-read.spss("C:\Rdata\ESS1_ICT.SAV") Erreur dans read.spss("C:RdataESS1_ICT.SAV") : impossible d'ouvrir le fichier I guess the error is
2011 Jan 11
1
sorting question
Hi, I have a data frame with variables a, b, c (character vars) and t (time var, could be represented as POSIXct or character, depending on which is most useful. The format is "yyyy-mm-dd hh:mm:ss CET"). Now, I want to sort the data frame in ascending order by a, b, c and then in descending order by t. Here's what I've got, but I'm not sure how to put the
2012 May 19
3
anovas ss typeI vs typeIII
Hi all, I have been struggling with ANOVAs on R. I am new to R, so I created a simple data frame, and I do some analyses on R just to learn R and then check them on SPSS to make sure that I am doing fine. Here is the problem that I've run into: when we use the aov function, it uses SS Type I as default (on SPSS it is Type III). Then I used the Anova function under cars package using the
2004 Dec 04
9
Excel *.xls files, RODBC
I gather from reading the back-issues of r-help that it should be possible (modulo a number of caveats) to read an excel (yuck!) file into R using RODBC. I have obtained and installed ODBC and the RODBC package, but cannot for the life of me figure out how to go about it. Can anyone give me a simple recipe? I have an excel file on cdrom, say: /mnt/cdrom/melvin.xls I have started R and loaded
2007 Apr 26
4
select if + other questions
Hi, i am trying to read a .txt file, do a couple of select if statements on my data, and then finally use the ?table function to get frequency counts on the data. Specifically, i am looking at answering the following question: What is the frequency of Grade 7 students in the province of Alberta who are smokers? I am having some problems: 1)i cannot get the column names to show up when print
2007 Apr 10
3
sas.get problem
I have 3 SAS files all in the directory F:/sas, two data files and a format file : form.ea1.sas7bdat form.ea2.sas7bdat sas.fmts.sas7bdat F is a USB. I am trying import them to R using "sas.get". I have not used SAS since I was downloading data from mainframe and having to write JCL. I had forgotten how bizarre SAS can be. I currently have not even figured out how to load the files
2006 Jun 06
2
SPSS variable lables import
Hi, I try to get the variable labels of a SPSS data file into R but don't find this mentioned in the help file for foreign. Is there another way to get them ? BTW: An SPSS variable name is like: VAR001, whereas the variable label might be 'Identification no.' Thanks in advance, F. Thomas -- .......................................... Dr. Frank Thomas FTR Internet Research 93110
2014 Jun 30
1
How to combine/join/merge etc PCA and Cluster?
Hello everybody, I Would like to get some help to plot together, Principal Components Analysis (PCA) and clusters. I am handling environmental data from 25 locations spread across 5 different ecosystems.When grouped into 5 clusters, locations from different ecosystems are arranged in the same group. So, I want to plot together PCA and Clusters, in a such way that locations belonging to the same
2011 Dec 10
3
PCA on high dimentional data
Hi: I have a large dataset mydata, of 1000 rows and 1000 columns. The rows have gene names and columns have condition names (cond1, cond2, cond3, etc). mydata<- read.table(file="c:/file1.mtx", header=TRUE, sep="") I applied PCA as follows: data_after_pca<- prcomp(mydata, retx=TRUE, center=TRUE, scale.=TRUE); Now i get 1000 PCs and i choose first three PCs and make a
2013 Apr 25
1
Weighted Principle Components analysis
Hello! I am doing Principle Componenets Analysis using "psych" package: mypc<-principal(mydata,5,scores=TRUE) However, I was asked to run a case-weighted PCA - using an individual weight for each case. I could use "corr" from "boot" package to calculate the case-weighed intercorrelation matrix. But if I use the intercorrelation matrix as input (instead of the