[R] R and SAS JMP
Hi everybody, my question is I have R installed in my system and SAS JMP version8 also installed in my computer. but how these two are related, how we can use these two tools for analysis. thanks in advance. -- View this message in context: http://old.nabble.com/R-and-SAS-JMP-tp26536257p26536257.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] numerical summaries across variables.
Hi Every one, I have a dataframe class with name, sex, age, height, Weight. if i caluclate summary statistics with the below code numSummary(class[,c(Height, Weight)], groups=class$Name, statistics=c(mean, sd, quantiles), quantiles=c(0, .25,.5,.75,1)) iam getting output like this Variable: Height mean sd 0% 25% 50% 75% 100% n Alfred 69.0 NA 69.0 69.0 69.0 69.0 69.0 1 Alice 56.5 NA 56.5 56.5 56.5 56.5 56.5 1 Barbara 65.3 NA 65.3 65.3 65.3 65.3 65.3 1 Carol 62.8 NA 62.8 62.8 62.8 62.8 62.8 1 Variable: Weight mean sd0% 25% 50% 75% 100% n Alfred 112.5 NA 112.5 112.5 112.5 112.5 112.5 1 Alice84.0 NA 84.0 84.0 84.0 84.0 84.0 1 Barbara 98.0 NA 98.0 98.0 98.0 98.0 98.0 1 Carol 102.5 NA 102.5 102.5 102.5 102.5 102.5 1 now my question is i want output like this height weight Alfred mean sd 0% 25% 50% 75% 100% n Alice mean sd 0% 25% 50% 75% 100% n Barbara mean sd 0% 25% 50% 75% 100% n it is nothing but a numerical summaries across varibales. is it possible. Thanks in Advance. -- View this message in context: http://www.nabble.com/numerical-summaries-across-variables.-tp25234915p25234915.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] changing the Date format.
Hi everyone, i have a data frame called 'sample'. in that 'sample' data frame variable called 'starts' is there like this starts 37987 37988 37989 37990 37991 now i want change that variable into '-mm-dd' format. can any body help in this aspect. Thanks in Advance. -- View this message in context: http://www.nabble.com/changing-the-Date-format.-tp25150494p25150494.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] how to apply a date format for data frame
Hi Everyone, i have a data frame like this labels starts ends priorities 1 firsttask 37987 38049 1 2 secondtask 38019 38112 2 3 thirdtask 38049 38144 3 4 fourthtask 38081 38207 4 5 fifthtask 38112 38239 5 now i want to apply a date format for the two variables they are starts and ends. please help in this aspect it would be appreciable. Thanks in Advance. -- View this message in context: http://www.nabble.com/how-to-apply-a-date-format-for-data-frame-tp25129192p25129192.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] formats
Hi every one, what do you mean by %d-%b-%y. is it reading format or writing format. Thanks in Advance. -- View this message in context: http://www.nabble.com/formats-tp25133503p25133503.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] error in creating gantt chart.
hi every one, i have a excel sheet like this labels starts ends 1 first task 1-Jan-04 3-Mar-04 2 second task 2-Feb-04 5-May-04 3 third task 3-Mar-04 6-Jun-04 4 fourth task 4-Apr-04 8-Aug-04 5 fifth task 5-May-04 9-Sep-04 now i converted this excel sheet into csv file and i read the csv file into R with the below code. my.gantt.info-read.csv(C:/Documents and Settings/balakrishna/Desktop/one.csv). and for create gantt chart i used below code. gantt.chart(my.gantt.info). if i run this above code i am getting the error like this Error in x$starts : $ operator is invalid for atomic vectors. can anybody help in this aspect it would be very appreciable. Thanks in Advance. -- View this message in context: http://www.nabble.com/error-in-creating-gantt-chart.-tp25115102p25115102.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] creating gantt chart
Hi every one, I have a R dataset like this. labels starts ends first task 2004-01-01 2004-03-03 second task 2004-02-02 2004-05-05 third task 2004-03-03 2004-06-06 fourth task 2004-04-04 2004-08-08 fifth task 2004-05-05 2004-09-09 now i want to create gantt chart for this data. can any body help us in code, it will be very helpful for us. Thanks in Advance. -- View this message in context: http://www.nabble.com/creating-gantt-chart-tp25078977p25078977.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] gantt chart for dataset
hi, Thanks for responding of gantt charts. but i have some problem regarding with gantt charts. i.e. Ymd.format - %Y/%m/%d Ymd - function(x){ as.POSIXct(strptime(x, format=Ymd.format))} gantt.info - list( labels =c(First task,Second task,Third task,Fourth task,Fifth task), starts =Ymd(c(2004/01/01,2004/02/02,2004/03/03,2004/05/05,2004/09/09)), ends =Ymd(c(2004/03/03,2004/05/05,2004/05/05,2004/08/08,2004/12/12)), priorities =c(1,2,3,4,5)) gantt.chart(gantt.info,main=Calendar date Gantt chart) the above code is fworking for individual varibale, that variables we have to specify manually for each variable. but my question is assume that above data stored in a excel file 'sample'. now i want gantt chart for the 'sample' dataset. -- View this message in context: http://www.nabble.com/gantt-chart-for-dataset-tp25079653p25079653.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] print selected variables
Hi every one, I read one excel external file into R, in that R dataset i have 20 variables. now my querry is i want to print only selected variables (eg:10 variables) with complete data. pls send me the code it will be very helpful for us. Thanks in Advance. -- View this message in context: http://www.nabble.com/print-selected-variables-tp25057378p25057378.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Re ad and merge a number of .xls files into one dataframe
christiaan pauw-2 wrote: Hi everybody I have a large number of Excel speadsheets that I want to merge into one R dataframe to process. I can read them one by one with read.xls but I really need a function to read a whole directory at once and merge the columns with the same name into a single dataframe. here is what I have thus far (on Mac OS X 10.5.2. for R 2.8.0): # Define the directory where the data is path=/Users/home/mydata/ # Make a list of the filenames (they are all .xls so no need for a regular expression seekig out ones ending in .xls ) files=list.files(path=/Users/home/mydata/) # Read them into a list called data data=tapply(paste(path,files,sep=),files[1:length(files)],read.xls) This gives the data in a list. What I want is a dataframe. I can turn it into a matrix with as.matrix() but that only has one column which is more or less the same as a list. I have tried to merge different parts of the list : mdata=date.frame(merge(data[[1]],data[[2]])) but that gives an empty data frame (with the correct variable names). Even if it worked I need a way to do that with a large number of file (i.e. not manualy). I also tried to use lapply with merge as function but that didn't work either Does anyone have any ideas? I would much appreciate it regards Chrisitiaan [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Hi, ya i am tried something on this. read excel sheets in asingle excel file by using datasetname=read.xls(path of Excel file,sheet=sheet number in that excel sheet). after creating R datasets to merge two datasets we use datasetname=merge (firsr dataset, second dataset, by.x=USUBJID, by.y=USUBJID). there should be a common variable in both the datasets then you will merge. -- View this message in context: http://www.nabble.com/Read-and-merge-a-number-of-.xls-files-into-one-dataframe-tp25056047p25056401.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Transpose a dataset
Hi Everyone, I have a dataset like this mean sd0% 25% 50% 75% 100% n BODY TEMPERATURE 36.41099 0.4015699 35.1 36.2 36.5 36.7 37.1 89 DIASTOLIC BLOOD PRESSURE 73.60079 9.4656186 50.0 67.0 73.0 80.0 95.0 253 HEIGHT 171.94000 9.2011670 153.5 166.5 173.0 176.25000 190.0 20 PULSE RATE67.48221 11.7657645 40.0 60.0 68.0 75.0 97.0 253 SYSTOLIC BLOOD PRESSURE 131.91700 14.4986667 97.0 122.0 132.0 140.0 185.0 253 WEIGHT85.17079 17.3150434 57.3 70.9 83.1 100.0 122.5 89 now i want to transpose this dataset like BODY TEMPERATURE mean 36.41099 sd 0.4015699 0%35.1 25% 36.222 50% 36.5 75% 36.667 100% 37.1 n89 DIASTOLIC BLOOD PRESSURE mean sd 0% 25% 50% 75% 100% n etc. if possible please send me the code. it will be very helpful us. Thanks in Advance. -- View this message in context: http://www.nabble.com/Transpose-a-dataset-tp25018071p25018071.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] how to Transpose a dataset
Hi everyone, How to a transpose a R dataset with a specified variable. If possible send the code. it will be very helpful for us. Thanks in Advance. -- View this message in context: http://www.nabble.com/how-to-Transpose-a-dataset-tp25006768p25006768.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] dispaly only character variables from the dataset in R
Hi everyone, After reading the external file into R it will become a R dataset. Now my querry is i want to dispaly only character variables from that dataset. please help me in this aspect. it will be very helpful for us. Thank you in Advance. -- View this message in context: http://www.nabble.com/dispaly-only-character-variables-from-the-dataset-in-R-tp25001544p25001544.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Display the character variables in a dataset in R
Hi everyone, After reading the external file into R it will become a R dataset. Now my querry is i want to dispaly only character variables from that dataset. please help me in this aspect. if possible send me the code. it will be very helpful for us. Thank you in Advance. -- View this message in context: http://www.nabble.com/Display-the-character-variables-in-a-dataset-in-R-tp25002163p25002163.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] cross tabulation for frequency distributions
Hi every one, how to get frequency distributions for one variable across other variable. ex: var1=age, var2=height i need frequency distribution of age across height. Thanks in Advance. -- View this message in context: http://www.nabble.com/cross-tabulation-for-frequency-distributions-tp24968531p24968531.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] forcasting or predictive analysis
Hi Every one, My question is I want to do forcasting or predictive analysis on some data and also genearte any graph based on the analysis. is it possible in R, if possible please give me the code it is very helpful for me. Thanks in Advance. -- View this message in context: http://www.nabble.com/forcasting-or-predictive-analysis-tp24950125p24950125.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] How to Import Excel file into R 2.9.0 version
Hi Every one, I have a problem with Reading Excel file into R 2.9.0 version. In older versions it is working with xlsReadWrite package. But in 2.9.0 version there is no package like that. so help me out in this aspect. Thanks in Advance. -- View this message in context: http://www.nabble.com/How-to-Import-Excel-file-into-R-2.9.0-version-tp24914638p24914638.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Import more than one sheet in a single excel file
Hi Every one, my question is, How to Import more than one sheet in a single excel file (e.g. 10 sheets in one excel file) into R and create datasets for all the sheets in a single excel file without specifying the sheetnames. Thank you in Advance. -- View this message in context: http://www.nabble.com/Import-more-than-one-sheet-in-a-single-excel-file-tp24917331p24917331.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Automatic datasets creation from multiple data sheets in a single excel file
Please let us know how to create automatic datasets from multiple data sheets in a single excel file... For example if there are 10 sheets in a single excel file, automatically 10 datasets need to be created at a time when i read an excel file as a whole at once. Please attach the necessary code if any... -- View this message in context: http://www.nabble.com/Automatic-datasets-creation-from-multiple-data-sheets-in-a-single-excel-file-tp24754120p24754120.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] R Packages and Permanent Datasets creation
Our Query: Actually while opening R console and R commander we see some packages like car and datasets. In these packages we have default datasets. For example: Women and Prestige so on. Now we created a Sales dataset importing either from excel, xml or text file. Now we are trying to store that dataset permanently in any one of the packages mentioned above (car or datasets). I am able to create them temporarily untill that pirticular session. But once we close the session and try to log into R Console and R Commander. We are not able to find the earlier created datasets Sales in the packages (Car and Datasets). Kindly suggest how to create permanent datasets in packages and also suggest how to create our own packages. If possible please send us the code it will be very helpful for us. -- View this message in context: http://www.nabble.com/R-Packages-and-Permanent-Datasets-creation-tp24713045p24713045.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.