我在Windows 8-1 x64上使用R 3.2x64和RStudio的开发版本(0.99)。我没有成功执行任何新包的R CMD检查,因为我已经抛出以下消息:" ...无法设置重新分析点"。
下面是更详细的日志:
Sys.junction中的警告(from,to): 不能设置重新分析点' Z:\ Temp \ Rtmpugnnnj \ RLIBS_b8462e13540 / markovchain',原因' Funzione non corretta' flink中的错误(where,tmplib): 无法从C链接:/Users/Giorgio/Documents/R/win-library/3.2/markovchain *删除' F:/GIGORGI〜1 /UNIVER~1 / LIFECO〜1 / LIFECO〜1.RCH / lifecontingencies'
环境低于指定值:
ALLUSERSPROFILE C:\ ProgramData APPDATA C:\用户\乔治\应用程序数据\漫游asl.log目的地=文件COMMONPROGRAMFILES C:\ Program Files文件\共同文件COMMONPROGRAMFILES(x86)的C:\程序文件(x86)\共同文件CommonProgramW6432 C:\ Program Files文件\ Common Files文件COMPUTERNAME SPEDYPC COMSPEC C:\ WINDOWS \ SYSTEM32 \ cmd.exe的DISPLAY:0 FP_NO_HOST_CHECK NO GFORTRAN_STDERR_UNIT -1 GFORTRAN_STDOUT_UNIT -1 HOME C:/用户/乔治/文件HOMEDRIVE C:HOMEPATH \用户\乔治LOCALAPPDATA C:\用户\乔治\应用程序数据\本地LOGONSERVER \ SPEDYPC NUMBER_OF_PROCESSORS 8 OS Windows_NT PATH C:\ Program Files文件\ r \ R-3.2.0 \ BIN \ 64; C:\ Rtools \ BIN; C:\ Rtools \ GCC- 4.6.3 \ BIN; C:\ ProgramData \ ORACLE \的Java \ javapath; C:\ Rtools \ BIN; C:\ Rtools \ GCC-4.6.3 \ BIN; C:\ WINDOWS \ SYSTEM32; C:\ WINDOWS; C ^ :\ Windows \ System32 \ Wbem; C:\ Windows \ System32 \ WindowsPowerShell \ v1.0 \; C:\ Program Files \ MiKTeX 2.9 \ miktex \ bin \ x64 \; C:\ Program Files(x86)\ NVIDIA Corporation \ PhysX \ Common; C:\ Program Files \ R \ R-3.2.0 \ bin \ x64 PATHEXT .COM; .EXE; .BAT; .CMD; .VBS; .VBE; .JS; .JSE; .W SF; .WSH; .MSC PROCESSOR_ARCHITECTURE AMD64 PROCESSOR_IDENTIFIER AMD64家庭21模型2步进0,AuthenticAMD PROCESSOR_LEVEL 21 PROCESSOR_REVISION 0200 ProgramData C:\ ProgramData PROGRAMFILES C:\ Program Files文件PROGRAMFILES(x86)的C:\程序文件(x86)ProgramW6432 C:\ Program Files文件PSModulePath C:\ WINDOWS \ SYSTEM32 \ WindowsPowerShell \ V1.0 \模块\ PUBLIC C:\用户\公用R_ARCH / 64 R_DOC_DIR C:/PROGRA~1/R/R-32~1.0/doc R_HOME C:/ PROGRA 〜1 / R / R-32〜1.0 R_LIBS_USER C:/Users/Giorgio/Documents/R/win-library/3.2 R_USER C:/用户/乔治/文件RMARKDOWN_MATHJAX_PATH C:/程序文件/ RStudio /资源/ mathjax-23 RS_LOCAL_PEER \ \管\ 34320-rsession RS_RPOSTBACK_PATH C:/ Program Files文件/ RStudio /斌/ rpostback RS_SHARED_SECRET 63341846741 RSTUDIO 1 RSTUDIO_MSYS_SSH C:/ Program Files文件/ RStudio /斌/ MSYS-SSH,1000年至1018年RSTUDIO_PANDOC C:/ Program Files文件/ RStudio / bin / pandoc RSTUDIO_SESSION_PORT 34320 RSTUDIO_USER_IDENTITY Giorgio SESSIONNAME控制台SystemDrive C:SystemRoot C:\ Windows TEMP Z:\ Temp TMP Z:\ Temp USER DOMAIN spedyPC USERDOMAIN_ROAMINGPROFILE spedyPC USERNAME Giorgio USERPROFILE C:\ Users \ Giorgio windir C:\ Windows
提前致谢
答案 0 :(得分:0)
最后,我成功地改变了:
#include <iostream>
#include <stdio.h>
#include <windows.h>
HANDLE hStdin;
DWORD fdwSaveOldMode;
void ErrorExit(LPSTR);
void KeyEventProc(KEY_EVENT_RECORD);
void MouseEventProc(MOUSE_EVENT_RECORD);
void ResizeEventProc(WINDOW_BUFFER_SIZE_RECORD);
void GetMousePosWin(MOUSE_EVENT_RECORD);
void gotoXY(int x, int y);
HANDLE console = GetStdHandle(STD_OUTPUT_HANDLE);
COORD CursorPosition;
int main()
{
DWORD cNumRead, fdwMode, i;
INPUT_RECORD irInBuf[128];
int counter=0;
// Get the standard input handle.
hStdin = GetStdHandle(STD_INPUT_HANDLE);
if (hStdin == INVALID_HANDLE_VALUE)
ErrorExit("GetStdHandle");
// Save the current input mode, to be restored on exit.
if (! GetConsoleMode(hStdin, &fdwSaveOldMode) )
ErrorExit("GetConsoleMode");
// Enable the window and mouse input events.
fdwMode = ENABLE_WINDOW_INPUT | ENABLE_MOUSE_INPUT;
if (! SetConsoleMode(hStdin, fdwMode) )
ErrorExit("SetConsoleMode");
// Loop to read and handle the next 100 input events.
gotoXY(33,10);
std::cout << "\xDB Menu Item 1";
gotoXY(33,12);
std::cout << "\xDB Menu Item 2";
gotoXY(33,14);
std::cout << "\xDB Menu Item 3";
gotoXY(33,16);
std::cout << "\xDB Quit";
while (!counter)//++ <= 200)
{
// Wait for the events.
if (! ReadConsoleInput(
hStdin, // input buffer handle
irInBuf, // buffer to read into
128, // size of read buffer
&cNumRead) ) // number of records read
ErrorExit("ReadConsoleInput");
// Dispatch the events to the appropriate handler.
for (i = 0; i < cNumRead; i++)
{
switch(irInBuf[i].EventType)
{
case KEY_EVENT: // keyboard input
KeyEventProc(irInBuf[i].Event.KeyEvent);
break;
case MOUSE_EVENT: // mouse input
MouseEventProc(irInBuf[i].Event.MouseEvent);
gotoXY(33,8);
GetMousePosWin(irInBuf[i].Event.MouseEvent);
break;
case WINDOW_BUFFER_SIZE_EVENT: // scrn buf. resizing
ResizeEventProc( irInBuf[i].Event.WindowBufferSizeEvent );
break;
case FOCUS_EVENT: // disregard focus events
case MENU_EVENT: // disregard menu events
break;
default:
ErrorExit("Unknown event type");
break;
}
}
}
// Restore input mode on exit.
SetConsoleMode(hStdin, fdwSaveOldMode);
return 0;
}
VOID ErrorExit (LPSTR lpszMessage)
{
fprintf(stderr, "%s\n", lpszMessage);
// Restore input mode on exit.
SetConsoleMode(hStdin, fdwSaveOldMode);
ExitProcess(0);
}
VOID KeyEventProc(KEY_EVENT_RECORD ker)
{
printf("Key event: ");
if(ker.bKeyDown)
printf("key pressed");
else printf("key released");
}
VOID MouseEventProc(MOUSE_EVENT_RECORD mer)
{
#ifndef MOUSE_HWHEELED
#define MOUSE_HWHEELED 0x0008
#endif
gotoXY(33,6);
printf("Mouse event: ");
switch(mer.dwEventFlags)
{
case 0:
if(mer.dwButtonState == FROM_LEFT_1ST_BUTTON_PRESSED)
{
gotoXY(46,6);
printf("left button pressed");
}
else if(mer.dwButtonState == RIGHTMOST_BUTTON_PRESSED)
{
gotoXY(46,6);
printf("right button pressed");
}
else
{
gotoXY(46,6);
printf("button press");
}
break;
case DOUBLE_CLICK:
gotoXY(46,6);
printf("double click");
break;
case MOUSE_HWHEELED:
gotoXY(46,6);
printf("horizontal mouse wheel");
break;
case MOUSE_MOVED:
gotoXY(46,6);
printf("mouse moved");
//gotoXY(12,13);
//GetMousePosWin();
break;
case MOUSE_WHEELED:
gotoXY(46,6);
printf("vertical mouse wheel");
break;
default:
gotoXY(46,6);
printf("unknown");
break;
}
}
// get Window pos through windows api
void GetMousePosWin(MOUSE_EVENT_RECORD mer)
{
int x,y;
// creates the handle i need to use
//HANDLE OutputH;
INPUT_RECORD Inrec;
DWORD evRead;
HANDLE hStdIn;
DWORD dwMode;
bool Captured=false;
hStdIn = GetStdHandle(STD_INPUT_HANDLE);
dwMode = ENABLE_WINDOW_INPUT | ENABLE_MOUSE_INPUT;
if( SetConsoleMode( hStdIn, dwMode | ENABLE_MOUSE_INPUT) == TRUE)
GetConsoleMode(hStdIn, &dwMode);
SetConsoleMode(hStdIn, (dwMode & (ENABLE_MOUSE_INPUT)));
// grab the handle to the console so i can use it
//OutputH = GetStdHandle(STD_OUTPUT_HANDLE);
//printf("Strated"); //Debug line.
do
{
PeekConsoleInput(hStdIn, &Inrec, 1, &evRead);
if( evRead )
{
ReadConsoleInput(hStdIn, &Inrec, 1, &evRead);
x= Inrec.Event.MouseEvent.dwMousePosition.X ;
y= Inrec.Event.MouseEvent.dwMousePosition.Y ;
switch (Inrec.EventType )
{
case MOUSE_EVENT:
{
Captured = true;
gotoXY(33,8);
std::cout << "x-> " << x << " ";
gotoXY(43,8);
std::cout << "y-> " << y << " ";
break;
}
}
}
}while(!Captured);
if((x==33 && y==10) && mer.dwButtonState == FROM_LEFT_1ST_BUTTON_PRESSED)
{
gotoXY(47,10);
std::cout << "\xFB";
gotoXY(33,21);
std::cout << "You picked menu one";
Sleep(1200);
gotoXY(47,10);
std::cout << " ";
gotoXY(33,21);
std::cout << " ";
}
if((x==33 && y==12) && mer.dwButtonState == FROM_LEFT_1ST_BUTTON_PRESSED)
{
gotoXY(47,12);
std::cout << "\xFB";
gotoXY(33,21);
std::cout << "You picked menu two";
Sleep(1200);
gotoXY(47,12);
std::cout << " ";
gotoXY(33,21);
std::cout << " ";
}
if((x==33 && y==14) && mer.dwButtonState == FROM_LEFT_1ST_BUTTON_PRESSED)
{
gotoXY(47,14);
std::cout << "\xFB";
gotoXY(33,21);
std::cout << "You picked menu three";
Sleep(1200);
gotoXY(47,14);
std::cout << " ";
gotoXY(33,21);
std::cout << " ";
}
if((x==33 && y==16) && mer.dwButtonState == FROM_LEFT_1ST_BUTTON_PRESSED)
{
gotoXY(40,16);
std::cout << "\xFB";
gotoXY(33,21);
std::cout << "You picked Quit";
Sleep(1200);
gotoXY(40,16);
std::cout << " ";
gotoXY(28,21);
exit(0);
}
}
VOID ResizeEventProc(WINDOW_BUFFER_SIZE_RECORD wbsr)
{
printf("Resize event\n");
printf("Console screen buffer is %d columns by %d rows.\n", wbsr.dwSize.X, wbsr.dwSize.Y);
}
void gotoXY(int x, int y)
{
CursorPosition.X = x;
CursorPosition.Y = y;
SetConsoleCursorPosition(console,CursorPosition);
}